User Tools

Site Tools


hstarwiki:cust:gen:chip

CHIP

!! See Notes in dropbox for specific implementation

Basic Setup

Usuefull tools on known system
  • Debian based but own system
  • uses systemd

Chip via tty

Pin out:

  • Black (Blue) to grnd
  • White to Tx
  • Green to Rx

Command:

  • $dmesg | grep tty
  • find tty dev name, like /dev/ttyUSB0
  • $picocom -d 115200 /dev/ttyUSB0

Default login

  • User: root
  • p:chip

Basic Wifi setup:

  • sudo nmcli device wifi connect '(your wifi network name/SSID)' password '(your wifi password)' ifname wlan0

tty info:

  • Baud Rate (Data Rate): 115200
  • Data Bits: 8
  • Parity: none
  • Stop bits: 1
  • Flow control: none

GPIO on CHIP

Relaxing Natural Bug bot

Steps:

  • Testing and documenting should be done at each step
  • Activate Standard GPIO on chip - DONE!
  • Activating PWM GPIO on chip
  • Understand commands for Standard GPIO DONE!
  • Build breadboard circuit DONE!
  • Turn on lights DONE!
  • Understand electrical current, voltages of basic setup
  • Use PWM
  • Make script for fading lights
  • Understand how to get more power
  • Writing Scripts in Python
  • Understand GPIO python libraries :https://github.com/xtacocorex/CHIP_IO
  • Testing with other items such as:
  • Motor
  • speaker
  • Input such as
  • Button
  • Temp sensor
  • gyro
  • wall sensor
  • gps
  • wireless rx and tx
  • Enclosure
  • Natural surface
  • Walking (I do not want rolling)

Old Project: Sun set light (a good idea still, but I like the bugs better)

  • Build physucal structure for setup
  • Create system for alarm variables (web interface)
  • Create App to set alarms and other variables
  • Refine app for visual appeal
  • Create system for adding wifi to chip (maybe bluetooth?)
  • Possible flash chip for lighter config

GPIO Chip Documentation

GPIO is not universal

Different boards have different GPIO pinouts. Make sure you understand this when changing boards. For chip there are baically 2 different versions based on the linux kernal. You can find this by going to /sys/class/gpio:

  • file gpio408 means version 4.3
  • file gpio1016 means version 4.4

In the future you may need to include code to compenstate for the different versions. See the chip GPIO page for more details
In our case, we are in kernal 4.3 so have gpiochip408. So you you add to 408 to corresponding P numbers

  • For XIO-P0 to XIO-P7
  • ex: XIO-P7 is gpio415

This is VERY important because you would use the string 'gpio415' for your code

Code with Pins

Below examples follow the same pin number in the example, gpio415.

View pin status

  • $cat /sys/class/gpio/gpio415/direction

A status has to be assigned to a pin for it to have this view, see below about setting pins

Setting In - Listen to pins

  • $sh -c 'echo 415 > /sys/class/gpio/export'
  • This line says to use the file export in that directory, and assgn it to the 415 pin, or XIO-P7. -c has to do with reading the command. Note: export is a high level file you can not read normally

Read value

  • $cat /sys/class/gpio/gpio415/value

You will notice that some of these commands do not necisarily have files associated with them. That is ok.

Setting out

  • $sudo sh -c 'echo out > /sys/class/gpio/gpio415/direction

assigning valule

You can assign a value to the

Cleanup

When you are done you should cleanup your pins so they are not in or out

  • $sudo sh -c 'echo 415 > /sys/class/gpio/unexport'
hstarwiki/cust/gen/chip.txt · Last modified: 2017-03-07 T 23:59 by admin