Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run (Linux Mint) #23

Open
sany3001 opened this issue Dec 9, 2023 · 6 comments
Open

Cannot run (Linux Mint) #23

sany3001 opened this issue Dec 9, 2023 · 6 comments

Comments

@sany3001
Copy link

sany3001 commented Dec 9, 2023

python3 run
up to date: scheduler.py
up to date: clock.py
up to date: main.py
up to date: wifi.py
up to date: localPTZtime.py
up to date: ds3231_port.py
up to date: test.py
up to date: helpers.py
up to date: config.json
up to date: pico_temperature.py
up to date: buttons.py
up to date: time_set.py
up to date: display.py
up to date: util.py
up to date: pomodoro.py
up to date: mqtt.py
up to date: rtc.py
up to date: apps.py
up to date: temperature.py
up to date: speaker.py
up to date: constants.py
up to date: configuration.py
Uploaded code

Traceback (most recent call last):
  File "/home/jiri/.local/bin/ampy", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1656, in invoke
    super().invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/jiri/.local/lib/python3.10/site-packages/ampy/cli.py", line 99, in cli
    _board = pyboard.Pyboard(port, baudrate=baud, rawdelay=delay)
  File "/home/jiri/.local/lib/python3.10/site-packages/ampy/pyboard.py", line 147, in __init__
    raise PyboardError('failed to access ' + device)
ampy.pyboard.PyboardError: failed to access /dev/cu.usbmodem14101

Is there any other way how to run clock?

@sany3001
Copy link
Author

sany3001 commented Dec 9, 2023

I have used Thonny to upload all files and run main.py from there. All ok! :-)

I also see that "run" is python script, so I will have a look on that why there is a problem with my serial port.

Great job! I will prepare fork of this repo.

@domneedham
Copy link
Owner

I use run as a bash script, so I am not sure. To be honest I ported this repo over to Rust and built it mostly again with that anyway. A fork and continued development in that is probably recommended!

@sany3001
Copy link
Author

I am quite new to Python. I see in your code a lot of stuff I have never used. There is probably no documentation available, right?

My goal was to reuse parts of your code (like display driver) and build own clock.
My clock shall be used by child with hear loss.

My current requirements:

  • clock battery powered
    ** keep display off by default because of that, activate it via button press
  • alternatively show also temperature received from internet (ThingSpeak server)
  • use "power" output to activate vibration motor to wake up person instead of using speaker
  • allow clock configuration via REST API or via other interface (just a level of comfort)

Maybe you will have some advice for me how to start. If not, I will keep trying to understand your code.
I have never used Apps/scheduler, so it will be challenging for me.

@domneedham
Copy link
Owner

Hi, yeah no docs available. I never got round to fully finishing off the project.

The apps concept is that one app can essentially take resources (like telling the buttons how to behave) and update the display.

The scheduler concept is just a small wrapper around uasyncio. Each task gets its own event loop which just runs a loop that calls some code every x milliseconds. In case of the display, that is the update leds function.

To disable the display, you would just need to remove and add a new task to the scheduler when a button press happens. You would obviously need to be scanning for the button press.

It's hard to be more exact unless I know exactly which areas and what parts you don't understand, but I'm happy to try and explain where I can.

@sany3001
Copy link
Author

sany3001 commented Dec 21, 2023 via email

@sany3001
Copy link
Author

sany3001 commented Jan 14, 2024

Hi Dom!
For me is your project too complex to reuse it. I want to try it another way.
I would like to start with "hello world" example.
Would you maybe advice how to activate single LED pixel? :-)
I want to go step-by-step. I will publish my work in some kind of blog on GitHub referencing your project.
(fork is maybe not the correct option for this case)

Thanks for potential reply!
Sany

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants