msparks / alphasign Goto Github PK
View Code? Open in Web Editor NEWImplementation of Alpha Sign protocols
Implementation of Alpha Sign protocols
$ python alphasign_example.py
Traceback (most recent call last):
File "alphasign_example.py", line 37, in
main()
File "alphasign_example.py", line 6, in main
sign = alphasign.USB(alphasign.devices.USB_BETABRITE_PRISM)
AttributeError: 'module' object has no attribute 'USB'
$ python -V
Python 2.7.13
$ which python
/usr/local/bin/python
Platform is OSX Sierra 10.12.6, I'm using python 2.7 from homebrew. Betabrite Prism USB-only version connected via USB. I've installed alphasign, libusb, pyusb and pyserial via pip. I have also installed libusb via "brew install libusb".
The alphasign_example is your example code from readthedocs, copy and pasted.
Thanks for this full featured looking module, any assistance getting it working in my env is greatly appreciated.
Edit -- Device shows up to OSX as follows
USB-BULK Device:
Product ID: 0x1234
Vendor ID: 0x8765
Version: 0.01
Serial Number: 123456
Speed: Up to 12 Mb/sec
Manufacturer: ADAPTIVE
Location ID: 0x14100000 / 14
Current Available (mA): 500
Current Required (mA): 100
Extra Operating Current (mA): 0
which matches the constant from devices.py
- :const:
USB_BETABRITE_PRISM
= (0x8765, 0x1234)
Edit 2 :
I look in /usr/local/lib/python2.7/site-packages/alphasign/interfaces/local.py and do not see a USB interface? grep -R USB in the base of the package does not find any results either.
Edit 3 :
Turns out homebrew + pip installs an ancient version of alphasign, 0.9, even though PyPi has 1.0.
I installed via
python setup.py install
from github head and my problem is resolved. Sorry for the noise, but hopefully it will be useful google fodder for future users.
The documentation link in the readme (http://readthedocs.org/docs/alphasign
) does not appear to work.
Installed alphasign manually and through PIP on both Windows and OSX. In both situations I receive the error "ImportError: No module named usb".
Is there anything I can do to remedy this issue? Kinda new to python so please let me know what kind of info I could provide to help us solve this problem.
Hi,
I hope you are still checking the project :-). Thanks for setting it all up.
I am trying to get the top and bottom lines to scroll at the same time. When I run the code below it will scroll the top and then when it is off the screen it will scroll the bottom. When the bottom is done, then back to the top.
How can I make it scroll the two lines at the same time?
Thanks...
The code below is basically what I am trying to do. My code isn't as clean as I would like but I have been trying lots of different things.
import time
import alphasign
import datetime
def main():
sign = alphasign.Serial(device="/dev/ttyS0")
sign.connect()
sign.clear_memory()
# create logical objects to work with
top_str = alphasign.String(label="A", size=80)
top_txt = alphasign.Text("%s%s" % (alphasign.colors.RED, top_str.call()),
label="A",
mode=alphasign.modes.COMPRESSED_ROTATE,
position=alphasign.positions.TOP_LINE)
bottom_str = alphasign.String(label="B", size=80)
bottom_txt = alphasign.Text("%s%s" % (alphasign.colors.GREEN, bottom_str.call()),
label="B",
mode=alphasign.modes.COMPRESSED_ROTATE,
position=alphasign.positions.BOTTOM_LINE)
# allocate memory for these objects on the sign
sign.allocate((top_str, top_txt, bottom_str, bottom_txt))
# tell sign to only display the counter text
#sign.set_run_sequence((top_str, top_txt, bottom_str, bottom_txt,))
sign.set_run_sequence((top_txt, bottom_txt,))
# Write the initial data.
top_str.data = '{}This is a long message that should scroll'.format( alphasign.speeds.SPEED_3)
bottom_str.data = '{}{}'.format( alphasign.speeds.SPEED_3, datetime.datetime.now().strftime('Today is %m/%d/%Y %H:%M'))
sign.write(top_str)
sign.write(top_txt)
sign.write(bottom_str)
sign.write(bottom_txt)
while True:
bottom_str.data = '{}{}'.format( alphasign.speeds.SPEED_3, datetime.datetime.now().strftime('Today is %m/%d/%Y %H:%M'))
#sign.write(top_txt)
sign.write(bottom_str)
#sign.write(bottom_txt)
time.sleep(10)
if __name__ == "__main__":
main()
I downloaded pyserial, pyusb, python 2.7, libusb, and got the vid and pid of the sign using libusb. When I try to run the code example on the alphasign api homepage, I get a core dump. :(
It is plugged in using a USB to RJ11 and I am writing the packets to /dev/ttyUSB0. Get feedback from console that the packets are being written but nothing is happening on the screen. Is it possible that I have the wrong cord? Not sure if this project is still being supported but any help would be awesome.
Edit: Looked into it more and I have the wrong pinout configuration
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.