Now came the fun part, sending the data. Fortunately, I had Tom Igoe’s Pi Recipes page, and his NodeSensors Github repository with the project. One of the first things we had to do was obtain an authorization token from Tom in order to be able to push data into the server. To obtain the key we first needed to find our MAC Address. With the Raspberry PI there will be two MAC addresses: one called eth0 and another called wlan0. I quickly used a google search to find this “Eth0 and wlan0 are not assigned by your ip, eth0 and wlan0 are device names assigned by ubuntu. Eth0 is your ehternet connection and wlan0 is your wireless connection but sometimes wlan0 might be called eth1 instead it all depends on the driver your wireless card is using.” ( found here). In any case, we would be connecting through WiFi, so wlan0 is our address.
With my MAC Address, the session key given to me, and my hostname I was ready to send the data as a json. This involved using the https npm package with requests. This can be seen in the Github repository.