Difference between revisions of "Raspberry Pi"

From OpenTHC
Line 81: Line 81:
 
== Serial ==
 
== Serial ==
  
  apt install python-serial
+
  apt install picocom python-serial
 +
picocom --baud 2400 --parity e --databits 7 /dev/ttyUSB0
  
 
* http://pyserial.readthedocs.io/en/latest/shortintro.html
 
* http://pyserial.readthedocs.io/en/latest/shortintro.html
Line 94: Line 95:
  
 
See `man stty` or https://unix.stackexchange.com/questions/242778/what-is-the-easiest-way-to-configure-serial-port-on-linux for details.
 
See `man stty` or https://unix.stackexchange.com/questions/242778/what-is-the-easiest-way-to-configure-serial-port-on-linux for details.
 +
 +
 +
=== Serial to USB ===
 +
 +
* http://amzn.to/2y26wwP - Large USB HUB, 13 Ports
 +
* http://amzn.to/2y5pSCO - Large USB HUB, 13 Ports
 +
* http://amzn.to/2y66LZw - 28 Ports
 +
* http://amzn.to/2xopbWp - 49 PORTS!!!
  
  

Revision as of 22:29, 3 December 2019

A number of the OpenTHC projects build on top of the Raspberry Pi platform. Projects such as EMC and POS use these tools for physical-world integrations.

Mostly, we don't care what case or hardware you choose for the Pi. Many of these tools will work on other similar platforms (eg: Banana Pi).

Operating System

Mostly we depend on Raspbian, recommend using a 16GiB MicroSD.

View downloads at https://www.raspberrypi.org/downloads/raspbian/

curl -vL https://downloads.raspberrypi.org/raspbian_lite_latest > raspbian.zip
unzip raspbian.zip
dd bs=1M if=2016-02-26-raspbian-jessie-lite.img of=/dev/mmcblk0

Then boot the Raspberry Pi

sudo -i
apt-get update ; apt-get upgrade
raspi-config


Cases


Cases + Touch Screen


Printing

Please also see the instructions in https://github.com/openthc/rpi

apt-get install cups

Configure CUPS

  • Add Printer
  • Select 'Share This Printer'
  • Model: 'Zebra ZPL Label Printer (en)'
  • Default Options: Set Page Size - 2.25 x 1.25
  • Fit to Page: Un-Check
  • Set Scaling to 100%


POE

For running these devices, many times it's desirable to get power delivered over the network wire, less cables to pull. There are pre-fab and DIY hats that can be attached to the Pi,


Breakout Boards


Serial

apt install picocom python-serial
picocom --baud 2400 --parity e --databits 7 /dev/ttyUSB0

View the tty Settings

for x in /dev/ttyUSB*; do echo "Port: \$x"; stty --file=\$x --all; done

Configure the tty settings, here it's basically 9600,8,n,1

stty --file=/dev/ttyUSB0 9600 cs8 -cstopb -parenb

See `man stty` or https://unix.stackexchange.com/questions/242778/what-is-the-easiest-way-to-configure-serial-port-on-linux for details.


Serial to USB


IR