User Tools

Site Tools


hstarwiki:cust:gen:chip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hstarwiki:cust:gen:chip [2016-11-21 T 18:45]
admin [GPIO Chip Documentation]
hstarwiki:cust:gen:chip [2017-03-07 T 23:59] (current)
admin
Line 8: Line 8:
   * http://docs.getchip.com/chip.html#wifi-connection   * http://docs.getchip.com/chip.html#wifi-connection
  
-==Default login== +==Usuefull tools on known system== 
-User: root p:chip+  * 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====== ======GPIO on CHIP======
-Relaxing Natural Bug bot+====Relaxing Natural Bug bot====
 Steps: Steps:
   * Testing and documenting should be done at each step   * Testing and documenting should be done at each step
-  * Activate GPIO on chip +  * Activate Standard GPIO on chip - DONE! 
-  * Understand commands for GPIO +  * Activating PWM GPIO on chip 
-  * Understand electrical current +  * Understand commands for Standard GPIO DONE! 
-  * Build breadboard circuit (Done) +  * Build breadboard circuit DONE! 
-  * Turn on lights +  * Turn on lights DONE! 
-  * Make script for fading lights (1 for on, one for off) +  * Understand electrical current, voltages of basic setup 
-  * Make script to run at certain times+  * 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   * Build physucal structure for setup
   * Create system for alarm variables (web interface)   * Create system for alarm variables (web interface)
Line 41: Line 86:
 \\ In our case, we are in kernal 4.3 so have gpiochip408. So you you add to 408 to corresponding P numbers  \\ 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    * For XIO-P0 to XIO-P7 
-  * ex: XIO-P0P7 is gpio415+  * 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.
  
-2017-07-17 +===Setting out=== 
-  * Followed most of tuturial and could get LED on, but it was not very bright +  * $sudo sh -c 'echo out > /sys/class/gpio/gpio415/direction 
-  * Also, not sure how to do PWM so need to do some more work+===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.1479753952.txt.gz · Last modified: 2017-03-03 T 17:15 (external edit)