====== CHIP ====== **!! See Notes in dropbox for specific implementation** * The basic chip guid and documentation is here: http://docs.getchip.com/chip.html * If you want to know how to boot into console, or to change back to grapical, jump to here: http://docs.getchip.com/chip.html#boot-into-console ====Basic Setup==== * Wifi Via command line: * http://docs.getchip.com/chip.html#wifi-connection ==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==== * http://docs.getchip.com/chip.html#gpio ====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'