Giter Site home page Giter Site logo

KiloBitBot function of buttons about bitbot HOT 6 CLOSED

uududde avatar uududde commented on August 13, 2024
KiloBitBot function of buttons

from bitbot.

Comments (6)

donbing avatar donbing commented on August 13, 2024

Thanks @uududde, glad it's working well for you (altho, what was the problem with the image based install?)

Currently, the button mappings are as follows (these did work on an inky impression), I'll give it a test to see if it's broken somehow.

5: self.toggle_picure_frame_mode,
6: self.refresh_display,
16: self.toggle_volume,
24: self.toggle_extended_view,

The config webserver has to be started as a separate python app.

Add cron jobs to start the app and config-server after reboot

(crontab -l 2>/dev/null; echo "@reboot sleep 30 && cd /home/pi/bitbot && python3 run.py") | crontab -
(crontab -l 2>/dev/null; echo "@reboot sleep 30 && cd /home/pi/bitbot && python3 src/config_webserver.py") | crontab -

from bitbot.

donbing avatar donbing commented on August 13, 2024

@uududde the buttons are working on my 5.6" impression when using the main branch.

from bitbot.

uududde avatar uududde commented on August 13, 2024

@donbing cool, I didn't know they were already implemented... so my idea of button three changing the style is even almost the same option you came up with.

I guess I should've watched syslog in the first place when trying out the buttons. Button 1 delivers an error, button 3 does not do anything (mybe broken), button 2 & 4 work as expected.

Button 1 gives me:

[CRITICAL] root: Uncaught exception
Traceback (most recent call last):
  File "/home/pi/bitbot/src/buttons.py", line 25, in <lambda>
    lambda pin: self.BUTTONS[pin](),
  File "/home/pi/bitbot/src/configuration/log_decorator.py", line 12, in wrapper
    result = func(*args, **kwargs)
  File "/home/pi/bitbot/src/buttons.py", line 34, in toggle_picure_frame_mode
    self.config.toggle_photo_mode(newstate)
TypeError: toggle_photo_mode() missing 1 required positional argument: 'cycle_state'

The problem with the image method was that directly after flashing even though delivering wpa data in the specific file and activating ssh via file before first boot the pi zero would not connect to the wifi.

Thanks I didn't see that the config server should be started by itself. Log says it's running but browser doesn't open it.

from bitbot.

donbing avatar donbing commented on August 13, 2024

The cycle_state error should now be fixed in main. I'm pretty sure that I've broken the refresh button by checking for config changes before updating the screen. That's going to be a bit fiddly to fix, so I might go with your suggestion of switching between currencies instead, thanks!

I've a feeling that the disk image doesn't support wpa_supplicant, it's based on comitup. it starts it's own hotspot allowing you to configure the WiFi from your phone/laptop, I'll check

from bitbot.

uududde avatar uududde commented on August 13, 2024

The cycle_state error is gone... now I receive:

[CRITICAL] root: Uncaught exception
Traceback (most recent call last):
  File "/home/pi/bitbot/src/input/buttons.py", line 26, in <lambda>
    lambda pin: self.BUTTONS[pin](),
  File "/home/pi/bitbot/src/configuration/log_decorator.py", line 12, in wrapper
    result = func(*args, **kwargs)
  File "/home/pi/bitbot/src/input/buttons.py", line 35, in toggle_picure_frame_mode
    self.config.toggle_photo_mode(newstate, False)
  File "/home/pi/bitbot/src/configuration/bitbot_config.py", line 100, in toggle_photo_mode
    self.config['picture_frame_mode']["cycle_pictures"] = cycle_state
  File "/usr/lib/python3.9/configparser.py", line 1258, in __setitem__
    self._parser._validate_value_types(option=key, value=value)
  File "/usr/lib/python3.9/configparser.py", line 1185, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings

from bitbot.

donbing avatar donbing commented on August 13, 2024

@uududde thanks for the error report, the branch called photo_button_fail introduces currency cycling instead.. I've not had time to test it yet, but i'll merge it into main once i have

from bitbot.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.