Changes between Version 44 and Version 45 of expansion/gw16122


Ignore:
Timestamp:
10/29/2018 11:23:24 PM (12 months ago)
Author:
Ryan Erbstoesser
Comment:

add thingsquare info

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16122

    v44 v45  
    620620The RF is at 500 kbps by default but can be adjusted in the source code.
    621621
     622=== Thingsquare ===
     623[http://www.thingsquare.com Thingsquare] is a software company that offers customized software for the chip on the GW16122, the Ti CC135x. This software allows for the use of a smartphone app to monitor and control sensors through the Thingsquare cloud/backend. A REST API is available as well.
     624
     625A brief description of what is happening in the demo below:
     626 * A Gateworks GW16122 is acting as the IoT Gateway on the Gateworks SBC
     627  * The GW16122 exposes a few serial interfaces (/dev/ttyACM0 and /dev/ttyACM1) which are then used for the SLIP interface
     628  * dnsmasq acts as a DNS server for the slip interface
     629  * The sl0 uses PTP for the DNS
     630  * The SLIP requires some routing and forwarding between interface sl0 and eth0
     631  * The firmware on the GW16122 pushes data up to the Thingsquare cloud
     632 * The CC1350 Sensor tag is reporting back to the Gateway and pushing it's information up to the cloud
     633
     634Hardware required as noted [#HardwareRequirements here]
     635
     636Steps:
     637 1. Flash the GW16122 and sensor nodes with Thingsquare Firmware located [https://www.thingsquare.com/docs/downloads/ here]
     638  1. GW16122 Firmnware: CC1350 Launchpad Serial USB Access Point (US / 915 MHz)
     639  1. Sensor Firmnware: CC1350 Sensortag
     640 1. Insert GW16122 into a Gateworks SBC Mini-PCIe slot that has USB support
     641 1. Load Gateworks SBC Ubuntu 16.04 Software
     642  1. Install Ubuntu Xenial 16.04 with the instructions [wiki:ventana/ubuntu#Ubuntu16.04LTSXenialXerusconsoleimage Ventana 16.04]
     643  1. Confirm /dev/ttyACM0 and /dev/ttyACM1 exist on the Gateworks SBC in software
     644  1. Confirm an ethernet cable is connected to the Gateworks SBC connected to a LAN that has internet access via a WAN
     645  1. Install dnsmasq{{{apt-get install dnsmasq}}}
     646  1. Add the following lines to the end of the /etc/dnsmasq.conf file:
     647{{{
     648interface=sl0
     649listen-address=127.0.0.1
     650listen-address=172.16.0.1
     651}}}
     652  1. Create a script or add to /etc/rc.local to be ran after the board boots each time:
     653{{{
     654modprobe slip
     655stty -F /dev/ttyACM0 115200
     656sleep 3
     657slattach -L -s 115200 -p slip /dev/ttyACM0 &
     658
     659sleep 10
     660ifconfig sl0 172.16.0.1 dstaddr 172.16.0.2
     661ifconfig sl0 mtu 600
     662
     663echo 1 > /proc/sys/net/ipv4/ip_forward
     664
     665iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
     666iptables -A FORWARD -i eth0 -o sl0 -j ACCEPT
     667iptables -A FORWARD -i sl0 -o eth0 -j ACCEPT
     668systemctl start dnsmasq.service
     669}}}
     670 1. Utilize the Thingsquare website to connect both sensor and Gateway to cloud with the following instructions: [http://www.thingsquare.com/docs/get-started-with-starter-kit/]
     671  1. Important Note: Checking the box 'Remote Access' is important to connect the device to the Thingsquare backend and available when logging into the app/browser with user account
     672 1. You can use the website [https://developer.thingsquare.com/web/] to access the devices from a PC browser. Create a Thingsquare account.
     673  1. Use the bottom menu icon, 'Nearby' to be sure you can discover the device on the LAN
     674
     675Screenshots:
     676
     677Troubleshooting:
     678 1. Verify traffic on sl0 interface with tcpdump
     679{{{
     680root@xenial-ventana:~# tcpdump -i sl0
     681tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
     682listening on sl0, link-type RAW (Raw IP), capture size 262144 bytes
     68317:04:02.516758 IP 172.16.0.2.10323 > ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https: Flags [P.], seq 12805:13034, ack 371767140, win 500, length 229
     68417:04:02.682914 IP ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https > 172.16.0.2.10323: Flags [.], ack 229, win 54500, length 0
     68517:04:02.685640 IP ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https > 172.16.0.2.10323: Flags [P.], seq 1:102, ack 229, win 54500, length 101
     68617:04:02.941381 IP 172.16.0.2.10323 > ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https: Flags [P.], seq 229:330, ack 102, win 500, length 101
     68717:04:03.148806 IP ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https > 172.16.0.2.10323: Flags [.], ack 330, win 54500, length 0
     68817:04:12.109625 IP 172.16.0.2.10323 > ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https: Flags [P.], seq 330:479, ack 102, win 500, length 149
     68917:04:12.276629 IP ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https > 172.16.0.2.10323: Flags [.], ack 479, win 55500, length 0
     69017:04:18.591617 IP 172.16.0.2.10323 > ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https: Flags [P.], seq 479:580, ack 102, win 500, length 101
     69117:04:18.756148 IP ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https > 172.16.0.2.10323: Flags [.], ack 580, win 55500, length 0
     69217:04:18.772626 IP 172.16.0.2.10323 > ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https: Flags [P.], seq 580:649, ack 102, win 500, length 69
     69317:04:18.941914 IP ec2-52-211-110-245.eu-west-1.compute.amazonaws.com.https > 172.16.0.2.10323: Flags [.], ack 649, win 55500, length 0
     694^C
     69511 packets captured
     69611 packets received by filter
     6970 packets dropped by kernel
     698root@xenial-ventana:~#
     699
     700}}}
     701
     702References:
     703 * Ti Thingsquare [http://www.ti.com/ww/en/internet_of_things/Thingsquare-for-TI-IoT-development-kits.html]
    622704
    623705{{{#!comment