-
Notifications
You must be signed in to change notification settings - Fork 3
Using Loom with Spool
While Loom can collect data and log it to Google spreadsheets and display the data, OPEnSLab created a website called Spool. Spool is a data logging and device management platform for Loom. There are not many hardware requirements, and while the software / Spool setup process has several steps, they are fairly short and easy.
If you are planning to use GoogleSheets, please check out here.
Loom offers logging to Spool via a few different methods: (unchecked if still in development)
- Ethernet
- WiFi
- 4G Cellular
Hardware: Adafruit Ethernet FeatherWing
Hardware: Adafruit Feather M0 WiFi - ATSAMD21 + ATWINC1500
Hardware: SparkFun LTE CAT M1/NB-IoT Shield - SARA-R4
You can find similar documentation in the Spool Wiki Page. You can check out here.
Spool can be found in this website or type spool.open-sensing.org
on your browser. Once you get into that website, you will be greeted with this website in the image below.
This is the Spool Home Page. This will be the website that you can see the data that you are sending to this site. However, to actually see it, you need to create a Network and Device.
To see data and that you are publishing, you need to get an account. For now, you need to request to Maddie Smith, who is in charge of maintaining the Spool website or need to create a user in your Auth0 tenant. Once you get an account, then login to the Spool to access your own personal network and devices.
Spool organizes your IoT system into devices and networks. A device is anything that creates data that is eventually stored in Spool. A network represents a collection of devices which communicate to Spool through a single authenticated coordinator device. For example, a typical sensor network might consist of five sensor devices and a central coordinator device that receives data from all five sensors and relays it to the internet. In Spool, this would be represented as a network with one coordinator device and five other devices. Only the coordinator device would receive security credentials and communicate with Spool directly. The other devices send their data to the coordinator, which sends it to Spool to be stored as data from the device it originated from. This way you can store and visualize data from individual devices without needing to connect all of them to the internet.
-
Make sure that you are logged in.
-
Click on Dashboard in the top left corner.
-
Click "Register New Network."
-
Add a network name and click "Register."
-
Now Spool gives you the security credentials that allow the device to safely upload data to the server. You'll want to download this and save it for later. Click "Download."
You've now created a new network! If you go back to the dashboard, you should see your new network there. Do not delete the file you just downloaded! That is important for the Device Configuration.
There is a bug with this process. Once the bug is complete, then it will be updated as soon as possible.
Open the file that you download from the Spool Website when you are creating the Network. In the file, you will see something similar to this.
{
"device_id":"5f32f5ec740dc0000803d001",
"certificate":"-----BEGIN CERTIFICATE-----\n<CERTIFICATE>\n-----END CERTIFICATE-----\n",
"private_key":"-----BEGIN EC PRIVATE KEY-----\n<PRIVATEKEY>\n-----END EC PRIVATE KEY-----\n"
}
Our SpoolWiFi
or SpoolEthernet
or SpoolLTE
are good starting examples. Open it in the Arduino IDE
The object in the configuration for the Spool module looks like the following:
{\
'name':'Spool',\
'params':[\
'Spool1',\
<Internet-Type>,\
'<coordinator-id>',\
'<device-id>',\
'<data-run>',\
'<certificate>',\
'<private-key>,'\
'device.open-sensing.org',\
'/api/device/data',\
]\
}\
All of the Spool publishing examples require this basic amount of information, look further below to find the specific details for each method of publishing:
The parameters in <brackets>
are values that you will need to provide
-
<Internet-Types>
7001 will be Ethernet, 7002 will be Wifi, and 7003 will be 4G -
'<coordinator-id>'
with the device-id of the Spool Network that you created in Spool previously -
'<device-id>'
with the device-id of the Spool Network that you created in Spool previously- Note that once the device setup is complete, this will change also
-
'<data-run>'
with the number for package- Note that this will be removed soon. Please check back if Loom and Spool makes an update
-
'<certificate>'
with the certificate of the Spool Network that you created in Spool previously- Make sure you add
-----BEGIN CERTIFICATE-----\n
and\n-----END CERTIFICATE-----\n
part: Copy everything for Certificate
- Make sure you add
-
'<private-key>'
with the private key of the Spool Network that you created in Spool previously- Make sure you add
-----BEGIN EC PRIVATE KEY-----\n
and\n-----END EC PRIVATE KEY-----\n
part: Copy everything for Private Key
- Make sure you add
- This information will be put into the
config.h
configuration file.
For SpoolWifi, you will need the following information:
- The host wifi network name, this should just be the network you’re currently connected to
- The host wifi network password, this is the password required for the network you’re connected to, leave as “” if there is no required password
For SpoolEthernet, you will need the following information:
- A MAC address, get this from your organization
- An IP address, you can use [192,168,0,1] if you don't have reason to change it
For SpoolLTE, you will need the following information:
- An Access Point Name (APN), will be from your nano sim card provider. Most likely to be hologram
- Potentially a GPRS username and password, if you have one, it will be provided by the nano sim card provider. If not, leave these two fields as “”
- If you wired one of the analog pins(A1-A5) from the Feather M0 to pin 5 on the LTE Shield, the name of the pin will be needed to automatically turn on the LTE shield. If this is not wired, leave as “” and turn the LTE shield on manually with the Power button after it is plugged into a power source.
Once the code compiles, upload it, open the Serial monitor an see if everything works properly. If so go continue to the next step, if not, review the previous steps
Once you've made it this far, you should be able to run the example code to get data logged to your Network and Device. Now you can tailor your device and the code to fit your project. Our Quick Start Guide and the code Documentation are likely good resources to start with to do this.
If you found any bugs, please submit those bugs on the Spool repository rather than Loom. You can find here to submit a bug on the Spool. If you are interested in supporting Spool to make a better data logging website, please check out their GitHub Page by clicking here and check out their Issues. For more questions or reference about Spool, please check out their Wiki page over here.