Code Monkey home page Code Monkey logo

displayotron's People

Contributors

adamchainz avatar akx avatar axelsimon avatar bennuttall avatar corteil avatar dglaude avatar doigal avatar fire-eggs avatar gadgetoid avatar imjoseangel avatar josephgeis avatar lowfatcode avatar nattster avatar pcarver avatar reedand avatar roguem avatar sevildevil1990 avatar therijn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

displayotron's Issues

AttributeError: 'AsyncWorker' object has no attribute 'isAlive'

Fresh Bullseye install, runnig Python 3.9.2

mmozzano@pi-red-coupe:~/python_scripts $ python --version
Python 3.9.2

Install of DisplayOTron library completes successfully with no issues but when I try and run code I see following error:

Traceback (most recent call last):
  File "/home/mmozzano/python_scripts/touch.py", line 95, in <module>
    def handle_up(ch, evt):
  File "/usr/local/lib/python3.9/dist-packages/dothat/touch.py", line 42, in reg                                                                                                        ister
    _cap1166.on(channel=button, event='press', handler=handler)
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 386, in on
    self.start_watching()
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 400, in start_watching
    self.async_poll.start()
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 208, in start
    if self.isAlive() == False:
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 409, in stop_watching
    self.async_poll.stop()
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 213, in stop
    if self.isAlive() == True:
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'
Exception ignored in: <function Cap1xxx.__del__ at 0x76894a48>
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 522, in __del__
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 409, in stop_watching
  File "/usr/lib/python3/dist-packages/cap1xxx.py", line 213, in stop
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'

This URL seems to imply the function isAlive has been changed to is_alive under Python 3.9 in file cap1xxx.py -

jupyter-vim/jupyter-vim#51

Sure enough manually making this change to /usr/lib/python3/dist-packages/cap1xxx.py and the DisplayOTron works as usual. Is this an issue with the DisplayOTron library itself?

Allow rainbow colours in radio

I noticed that there is an example which allows the display to display a rainbow of colours continuously, but you cant access that in the radio, you can only set a fixed colour. I tried adding in the functionality but ended up crashing the program - is there any way to add in the rainbow colour functionality into the radio example?

[Suggestion] A class for "tables"

There are some use cases (like transit time table, etc), where it is useful to devide the display in to columns. (For example: Line Num, Destination, Remianing Mins)
It would be really cool if this can be done with the flexibility to set L/R-Aligned, and a scroll method for longer stuff (In this case destination)

Error installing examples

I got an error on instal.

bash: line 690: git: command not found

And it failed to load the examples into /Pimioroni/displayotron (no dot3K directory)

Which means it doesn't work!

Alignment Issues

Hi, I'm using a Displayotron 3000 on a Raspberry Pi 3 and I'm having some difficulty having the text characters align properly, as when I run the sample "Hello World" script, the display cuts off some characters and displays "ello World". Changing the script to print " Hello World" makes it work. However, the alignment issues are different for different sets of characters, as some will only be off by 1 character while others will be offset by 2 or 3.

Thanks,
Nixpower

Constant CPU usage of at least 20%

When using any of the dothat.touch event handlers (e.g. @touch.on(touch.UP)), while running top I noticed that the python process is constantly using at least 20% CPU. This is the case even when I don't touch any of the buttons on the Display-O-Tron HAT. When I removed the @touch.on event handlers, CPU usage went down to pretty much 0%.

I tested the same thing with the dot3k.joystick event handlers (e.g. @joystick.on(joystick.UP)), but those seem to work just fine. Pretty much no CPU load while idle, so it looks like this problem only exists for the touch event handlers.

Could you guys please take a look at this?
Thank you very much in advance!

Wrong text after run demo script

If I ran script sudo python hello_world.py then I see only "ello World".
If I ran this manually in console line by line then I see "Hello World".

I have new Pi2 - is my device too fast? :P

Preselect menu option on startup

Is there a possibility to programmatically select a menu option on startup? For example, I would like to start the program and immediately see the Clock and not the menu.

Experimental support warning with Raspbian Stretch

Installing the Display-o-Tron software using the one-liner on the new Raspbian Stretch image generates the "Support for your operating system is experimental. Please visit forums.pimoroni.com if you experience issues with this product" warning (installation continues). I imagine this extends to all the Pimoroni one-line installers. Is this something that should be fixed, or is Stretch testing not complete?

Also, in this instance, the installer complains that it's "Unable to install smbus for python 3!"

Node-Red integration

Any suggestions on how to link the display-o-tron to node-red, just thinking it would be great parsing IOT things from node-red to the display.

Python 3 inputs

Hi there I am using the dothat on a RP3 and have encountered some problems. I am creating an Attendance system and as part of that, they have to enter their staff id. What I can't seem to so is get the raspberry pi to do is;
On one line write please enter your staff id here. (i can do this on its own but not with the following)

Then when they use the USB keypad I would like the screen to show what they are typing. Is this possible? If so can someone either link me to some examples or put some in the comments. Many thanks.
Elliott

PermissionError when using without root/sudo

Always getting an PermissionError when trying to import the lcd-module:

Tried to fix it with file-permissions in the lib-directory, but that does not seem to be the problem.

Here is the full error:

Traceback (most recent call last): File "touch.py", line 10, in <module> import dothat.lcd as l File "/usr/local/lib/python3.4/dist-packages/dothat/lcd.py", line 6, in <module> lcd = st7036.st7036(register_select_pin=25, reset_pin=12) File "/usr/local/lib/python3.4/dist-packages/st7036.py", line 40, in __init__ self.spi.open(0, spi_chip_select) PermissionError: [Errno 13] Permission denied

EDIT: python-installation over pip (into a virtual-env) would be great, too.

Displayotron HAT No Response - Blank Screen - Under many circumstances

Dear Forum, Relative to this Post (which I do not completely understand what is to be done) please respond to my Displayotron Problems

I have two Displayotron HATS. I had one working at one time. Currently, neither of them are responsive after installing three different ways; through Pimoroni Dashboard, the one-liner starting with curl -sS, and the one-liner starting with curl get.pimoroni.***. Both Raspberry Pi Zero W or Raspberry Pi 2 were tested. Each have been attempts with either Stretch or Jessie.

On all these attempts, the Raspberry Pi operates normally with several different programs functioning successfully. Under all these attempts, the device has no output and screen is blank. I must be missing something.

The following is a session output to explain the problem:
Please help, Thank You, Frank.

pi@raspberrypi:~ $ ls
adafruit-pitft.sh Downloads Pictures python_games
Desktop install-piface-real-time-clock.sh Pimoroni Templates
Documents Music Public Videos
pi@raspberrypi:~ $ cd Pimoroni
pi@raspberrypi:/Pimoroni $ ls
displayotron
pi@raspberrypi:
/Pimoroni $ cd displayotron/examples/dothat/basic
pi@raspberrypi:/Pimoroni/displayotron/examples/dothat/basic $ ls
backlight.py graph.py hello_world.py ipaddr.py room.py touch.py
pi@raspberrypi:
/Pimoroni/displayotron/examples/dothat/basic $ python touch.py
Traceback (most recent call last):
File "touch.py", line 6, in
import dothat.lcd as lcd
File "/usr/local/lib/python2.7/dist-packages/dothat/lcd.py", line 6, in
lcd = st7036.st7036(register_select_pin=25, reset_pin=12)
File "/usr/lib/python2.7/dist-packages/st7036.py", line 42, in init
self.spi.open(0, spi_chip_select)
IOError: [Errno 2] No such file or directory
pi@raspberrypi:/Pimoroni/displayotron/examples/dothat/basic $ python hello_world.py
Traceback (most recent call last):
File "hello_world.py", line 3, in
import dothat.lcd as lcd
File "/usr/local/lib/python2.7/dist-packages/dothat/lcd.py", line 6, in
lcd = st7036.st7036(register_select_pin=25, reset_pin=12)
File "/usr/lib/python2.7/dist-packages/st7036.py", line 42, in init
self.spi.open(0, spi_chip_select)
IOError: [Errno 2] No such file or directory
pi@raspberrypi:
/Pimoroni/displayotron/examples/dothat/basic $ python backlight.py
Traceback (most recent call last):
File "backlight.py", line 7, in
import dothat.lcd as lcd
File "/usr/local/lib/python2.7/dist-packages/dothat/lcd.py", line 6, in
lcd = st7036.st7036(register_select_pin=25, reset_pin=12)
File "/usr/lib/python2.7/dist-packages/st7036.py", line 42, in init
self.spi.open(0, spi_chip_select)
IOError: [Errno 2] No such file or directory
pi@raspberrypi:~/Pimoroni/displayotron/examples/dothat/basic $

Install one-liner not fetching up-to-date examples

I've just installed the Display-o-Tron software using the curl -sS get.pimoroni.com/displayotron | bash one-liner (on a Pi Zero W, Raspbian Jessie, with everything up to date), and have noticed that there are fewer examples in the resulting 'full install' than there are in the main branch of the GitHub repo, specifically in the basic folder of both the dot3k and dothat folders.

Changing copyhead="no" to copyhead="yes" in the installer bash script solves this, but I'm guessing there is a better solution than that.

The same is also true for the Blinkt library. I'll file a separate issue for that.

I think your current folder structure is different when run from your install command

Can we use this library on bullseye?

Trying to install the library on a fresh install of bullseye by running:

curl -sS get.pimoroni.com/displayotron | bash

I get the following error:

Selecting previously unselected package python3-spidev.
(Reading database ... 45053 files and directories currently installed.)
Preparing to unpack .../python3-spidev_2.0~git20150907_armhf.deb ...
Unpacking python3-spidev (2.0~git20150907) ...
dpkg: dependency problems prevent configuration of python3-spidev:
 python3-spidev depends on python3 (<< 3.5); however:
  Version of python3 on system is 3.9.2-3.

Looks like bullseye comes with Python 3.9 but the DisplayoTron library requires 3.5 or lower?

install script: '301 Moved Permanently'

Hi! I have a dot3k, and I'm re-installing on a Pi4 / Raspberry Pi OS Lite (64bit Debian Bookworm).

The install instructions download the redirect file:

$ curl -sS get.pimoroni.com/displayotron
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.18.0 (Ubuntu)</center>
</body>
</html>

Could you please update so it follows redirects:
curl -sSL get.pimoroni.com/displayotron | bash

Thanks 😁

IOError: [Errno 2] No such file or directory - after running rpi-update

We've become aware of an issue with the new device-tree enabled kernel which requires i2c to be enabled in config.txt ( although I've been told this behaviour is being reverted so that i2c is enabled, but modules not inserted by default ).

If you're a regular uses of rpi-update, and you're seeing an error like this:

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    import skywriter
  File "/usr/local/lib/python2.7/dist-packages/skywriter-0.0.2-py2.7.egg/skywriter.py", line 31, in <module>
    i2c = SMBus(i2c_bus_id())
IOError: [Errno 2] No such file or directory

Then please read this thread: http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314

If you're here because you're seeing a similar error, but don't use rpi-update, then please try our installer script:

curl get.pimoroni.com/dot3k | bash

pip install does not install current version

Is there a reason why not to update the version installable with pip install? The pip-version is installed by your installation-script and there is at least one error that is already fixed in the master branch.

Bernhard

support for Python 3.5

Will the 3k and hat ever support Python 3.5? I'm fully aware that Raspian doesn't officially support Python 3.5. But I was wondering if there are any plans for a 3.5 version due the fact that people (my self included) can easily build Python3.5 for them self's.

03_doing_stuff.py error

'ello! When I try to run the 03_doing_stuff.py script, I get the following error:

Traceback (most recent call last):
  File "03_doing_stuff.py", line 226, in <module>
    menu.redraw()
  File "/usr/local/lib/python2.7/dist-packages/dot3k/menu.py", line 236, in redraw
    self.current_value().redraw(self)
  File "03_doing_stuff.py", line 163, in redraw
    text=self.get_prev_option()
  File "/usr/local/lib/python2.7/dist-packages/dot3k/menu.py", line 199, in write_option
    current_row += icon
TypeError: cannot concatenate 'str' and 'NoneType' objects
Config saved to dot3k.cfg

Extended character set ?

Is there any documentation on any extended character set ? For example is there a degrees symbol ? (usually chr(223) )

Use on RTk GPIO

Would it be possible to adapt the library to use this with the RTk GPIO board? I would love to be able to use this for a small display running off my Windows machine.

Wrong colour order?

I unpacked the Display-O-Tron 3000 an hour ago, so correct me if I'm wrong. I'm a bit confused by the dot3k.backlight.rgb command, because actually the order of the parameters is dot3k.backlight.rgb(red, BLUE, GREEN). I've noticed this in the basic example 'joystick.py'. Pushing the joystick down results in blue backlight (b.rgb(0,255,0)), pushing it left results in green light (b.rgb(0,0,255)).

How can I reference an individual LED on dothat?

Can I reference an individual backlight LED in the dothat library so I can get something like this? The rows are the individual lights, (R = Red, B = Blue)

[ 1 | 2 | 3 | 4 | 5 | 6 ]
[ R | B | R | B | R | B ]

Menu order confuses path

Using menu.add_item to build a configuration menu, with Backlight(backlight) as a test class.

DotHAT on Pi3 using dothat/advanced/menu.py as source file to rewrite.

menu.add_item('Blue Order/Launch', Backlight(backlight))
menu.add_item('Blue Order/Main patch/E-mu Modular/Fat square', Backlight(backlight))
menu.add_item('Blue Order/Main patch/E-mu Modular/Fat Saw', Backlight(backlight))
menu.add_item('Blue Order/Main patch/Steinway/Hall performance', Backlight(backlight))
menu.add_item('Blue Order/Main patch/Steinway/Honky tonk', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/1', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/2', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/3', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/4', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/5', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/6', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/7', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/8', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/9', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/10', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/11', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/12', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/13', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/14', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/15', Backlight(backlight))
menu.add_item('Blue Order/Channel assignments/16', Backlight(backlight))
menu.add_item('Blue Order/Reverb', Backlight(backlight))
menu.add_item('Blue Order/Chorus', Backlight(backlight))
menu.add_item('AmSynth/Launch', Backlight(backlight))
menu.add_item('Pure Data/Launch', Backlight(backlight))
menu.add_item('Effects/Launch', Backlight(backlight))

The root menu shows:
Blue Order
E-mu Modular
Steinway
Channel assignments
AmSynth
Pure Data
Effects

But, E-mu Modular, Steinway, and Channel assignments are supposed to be sub-menu items as defined in the path defined in each menu.add_item. Also, they are missing from their parent item of Blue Order.

Choosing a menu item such as Steinway yields this sequence of sub-menu items...

Steinway>Main patch>Blue Order>Honky tonk

...which is totally out of sequence as defined in menu.add_item.

Am I missing something here? Some weird punctuation treatment of spaces or something?

dotHAT for non-raspbian distribution

Actually using Ubuntu-MATE 15.10..
i modified displayotron bash script to 'not' checking distro

-- IS_RASPBIAN=$(cat /etc/-release | grep "Raspbian")
++ IS_RASPBIAN=$(cat /etc/
-release | grep "Ubuntu")

and removed some package not present in repositories

--pkgdeplist=( "git" "python-pip" "python-rpi.gpio" "python-smbus" "python-dev" "python3-pip" "python3-rpi.gpio" "python3-dev" ) # list of all the mandatory apt dependencies
++ pkgdeplist=( "git" "python-pip" "python-rpi.gpio" "python-smbus" "python-dev" "python3-pip" "python3-rpi.gpio" "python3-smbus" "python3-dev" ) # list of all the mandatory apt dependencies

afterward, tried to do so manually (with help of this website ) and then, launched DOT script.

Result:

Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 304, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1235, in prepare_files
req_to_install.assert_source_matches_version()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 465, in assert_source_matches_version
% (display_path(self.source_dir), version, self))
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 71, in display_path
if path.startswith(os.getcwd() + os.path.sep):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128)

Storing debug log for failure in /home/lowlow/.pip/pip.log
Python 2 library install failed!

class for the breakout

I think it will be really nice to have a standalone class for the breakout board
Like this.

from dotbreakout import blah

It will make a lot of sense if you can set the pins used without changing the library and setup PWM with just something like backlight.foo()

Does not install with pip and sudo

Hi! I have a dot3k, and I'm re-installing on a Pi4 / Raspberry Pi OS Lite (64bit Debian Bookworm).

I needed to alter the script at get.pimoroni.com/displayotron to install. After each sudo pip install command I needed to add a flag to allow it to install to the system packages. See the diff:

822c822
<             if ! sudo -H $PIP2_BIN install --upgrade "$piplibname"; then
---
>             if ! sudo -H $PIP2_BIN install --upgrade "$piplibname" --break-system-packages; then
833c833
<             if ! sudo -H $PIP3_BIN install --upgrade "$piplibname"; then
---
>             if ! sudo -H $PIP3_BIN install --upgrade "$piplibname" --break-system-packages; then
890c890
<                     sudo -H $PIP2_BIN install "$moredep"
---
>                     sudo -H $PIP2_BIN install "$moredep" --break-system-packages
898c898
<                     sudo -H $PIP3_BIN install "$moredep"
---
>                     sudo -H $PIP3_BIN install "$moredep" --break-system-packages
907c907
<                 sudo -H $PIP2_BIN install "$pipdep"
---
>                 sudo -H $PIP2_BIN install "$pipdep" --break-system-packages
910c910
<                 sudo -H $PIP3_BIN install "$pipdep"
---
>                 sudo -H $PIP3_BIN install "$pipdep" --break-system-packages

Perhaps a more elegant way would be to use a venv, but the board needs root access anyway...! 😆

Broken links in README.md

The links to 'python/examples' and 'function reference' in README.md give me Github's 404 page. I attempted to make the amends myself and send a pull request but that was only going to lead to disaster.

[Request] New line with “\n”

I am writing a code that should run both on DOT and “Normal” 16x2 displays, and I have a dict for the stings for display.

return_code = {
#...
-11: "Server Not\nAvailable”,
#...
}

It would be nice if the lib can take \n into account and make a new line accordingly, it will come in REALLY handy if you need to print some really long strings in German
(Without over-spagettify-ing the code)

Issue when running game.py example (Python 3.9.2)

Steps: run game.py from the examples directory -

~/Pimoroni/displayotron/examples/dothat/advanced $ ./game.py 

This advanced example uses the menu framework.
It loads the debris game plugin. Your score is
time survived in seconds, see how well you can do!

Press CTRL+C to exit.

[(14, 3), (10, 3), (6, 2), (11, 3), (14, 0), (12, 3), (9, 2), (8, 0), (11, 5), (8, 1)]
Traceback (most recent call last):
  File "/home/zimchaa/Pimoroni/displayotron/examples/dothat/advanced/./game.py", line 40, in <module>
    menu.run()
  File "/usr/local/lib/python3.9/dist-packages/dot3k/menu.py", line 129, in run
    self._thread.start()
  File "/usr/local/lib/python3.9/dist-packages/dot3k/menu.py", line 42, in start
    if not self.isAlive():
AttributeError: 'AsyncWorker' object has no attribute 'isAlive'
Config saved to dot3k.cfg

Seems to be related to, but not solved by the checking of the installation of Cap1xxx

$ python3 -m pip freeze | grep Cap1xxx
Cap1xxx==0.1.4

#66 - created a pull request (apologies if I've not done this correctly) that resolves this issue by editing menu.py to use is_alive instead of isAlive.

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.