Back to Smartcitizen.me

Cannot publish sensor data

I have an older (r1.1) sensor, that I never ran live as I was renovating the house. Now I have the perfect place for it, but need to set it up.

So I install chrome, the SC chrome setup extension which seems to open up pages in my default browsers. So I paste URIs back to a chrome tab) and struck what may be a firmware issue:

Entered the node details for the website, sensor’s mac address, eg (xx:xx:xx:xx:xx:xx, where xx is hex values) and followed the link to setup the sensor. This ‘terminal page’ shows the correct serial port (via local USB). The page prompts to:

✓ Please reset your kit
✓ Press the reset button or switch it off-on.
✓ Select your kit Serial Port
✓ And click Start process…
✓ We can’t open the serial port!!!
✓ Make sure no application is using the serial port (ex. Arduino IDE)
✓ Please try reloading this page
✓ And resetting your kit.

I did this, with similar results:

✓ Please reset your kit
✓ Press the reset button or switch it off-on.
✓ Select your kit Serial Port
✓ And click Start process…
✓ Still working, looking for older firmware…
✓ We can’t open the serial port!!!
✓ Make sure no application is using the serial port (ex. Arduino IDE)
✓ Please try reloading this page
✓ And resetting your kit.
✓ Unrecognized board!
✓ Make sure you have selected the right port!
✓ If you are sure, click Install Firmware

I am not sure. Did not click ‘Install Firmware’

Tried the above again with Chrome set as default browser. Makes no difference, in the config tool app extension, after pressing Login, the app links the browser to login.html. Browser just finds:

404 Not Found
The current resource could not be found on Smart Citizen

Same thing happens whether chrome has a current, authenticated session or not.

What to do now?

Is this just because of the 404 or is it that the old firmware is not being recognised?

I have two configurations saved under my profile in the website, one shows as ‘Never published’, the other ‘Not configured’.

Perhaps there is a way to configure the WiFi and other sensor config manually, push the firmware via tftp or ssh? << Just found the documentation. Will try getting in via serial console

I left it connected whilst having dinner and it looks like things have progressed quite well within the browser-

SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
Firmware version 0.9.4 (latest)
Reinstall Firmware
Mac Address: xx:xx:xx:xx:xx:xx
Wi-Fi Networks
Add +
SSID
Password

Update interval
Sensor reading every 1 minute
Publishing 1 post every 1 minute
Reading interval
Number of posts
Sync settings.

But alas, the next challenge is the password/phrase dialogue will only allow 19 or 20 chars…
Hmmmm… Firmware is latest! Yes!

OK so I setup a SSID net with <20 char passphrase. Then added the credentials into the Babelfish terminal and pressed sync settings. Restarted sensor as prompted. Boom, updated and online!

✓ And click Start process…
✓ Your kit is a:
✓ SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
✓ Your kit is running 0.9.4 firmware.
✓ This is the latest version.
✓ You can skip the firmware update!
✓ SCK >> Wifi conection failed!!! Using ssid: removed: removed
✓ SCK >> Try restarting your ✓ SCK >> kit!!✓ You can skip the firmware update!
✓ SCK >> Wifi conection failed!!! Using ssid: removed and pass: removed
✓ SCK >> Try restarting your ✓ SCK >> kit!!
✓ SCK >> RTC not updated!!!
✓ SCK >> With no valid time it’s useless to take readings!!
✓ SCK >> Trying to get valid time…
✓ SCK >> Wifi conection failed!!! Using ssid: removed and pass: removed
✓ SCK >> Try restarting your kit!!
✓ SCK >> RTC not updated!!!
✓ SCK >> With no valid time it’s useless to take readings!!
✓ SCK >> Trying to get valid time…
✓ SCK >> Wifi conection failed!!! Using ssid: removed and pass: removed
✓ SCK >> Try restarting your kit!!✓ SCK >>
✓ SCK >> RTC not updated!!!
✓ SCK >> With no valid time it’s useless to take readings!!
✓ SCK >> Trying to get valid time…
✓ Saving wi-fy network settings…
✓ Update interval haven’t change!
✓ Settings synced!
✓ For your kit to work properly
✓ Please push the RESET button or simply turn your kit ON/OFF
✓ Your kit is connected to WI-Fi!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ SCK >> RTC Update Failed!!
✓ SCK >> RTC not updated!!!
✓ SCK >> With no valid time it’s useless to take readings!!
✓ SCK >> Trying to get valid time…
✓ Your kit is connected to WI-Fi!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ Your kit is connected to WI-Fi!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ Wi-fy networks haven’t changed!
✓ Update interval haven’t change!
✓ Nothing to sync!!
✓ Wi-fy networks haven’t changed!
✓ Update interval haven’t change!
✓ Nothing to sync!!
✓ Your kit is connected to WI-Fi!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ Wi-fy networks haven’t changed!
✓ Update interval haven’t change!
✓ Nothing to sync!!
✓ Wi-fy networks haven’t changed!
✓ Update interval haven’t change!
✓ Nothing to sync!!
✓ Your kit is connected to WI-Fi!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ Your kit has updated his clock!
✓ SCK >> RTC Updated!!
✓ SCK >> Error in connection!! Data saved in memory
✓ SCK >> Pending updates: 3
✓ SCK >> *******************
✓ SCK >> Temperature: 26176 C RAW
✓ SCK >> Humidity: 31816 % RAW
✓ SCK >> Light: 114.90 lx
✓ SCK >> Battery: 100.00 %
✓ SCK >> Solar Panel: 0 mV
✓ SCK >> Carbon Monxide: 84092.55 kOhm
✓ SCK >> Nitrogen Dioxide: 5.32 kOhm
✓ SCK >> Noise: 0 mV
✓ SCK >> Wifi Spots: 0
✓ SCK >> UTC: 2018-10-29 12:43:54
✓ SCK >> *******************

OK, so the device is up to date, but chrome is still saying the site is ‘Waiting for your kit’s data’. The sensor has a local IP. Perhaps I just have to get the outbound data through the firewall- but there is no blocking on TCP:80 and 443.

After waiting a few hours, the Profile is yet to see any data.

The only packets the firewall is stopping are broadcasts to 255.255.255.255 on UDP:55555 and the request to rn.microchip.com (198.175.253.161) on TCP:21

Why? Who are Microchip Technology Inc. (MICROC)? Why is the sensor sending data there?
I opened TCP:21 (but why should is it needed?).

Will leave it a long time again, see if it heals itself…

Allowing TCP:21 made no difference

Now opening access to any host, on any port, for the Sensor. Seemingly this makes no difference too, except for the UDP:5555 broadcasts.

P.S.
From the start, valid data from the sensor showed in the terminal window in the setup tab. It shows my old Wifi password from 2 years ago, and stream of ‘healthy’ data:

✓ SCK >> 4✓ SCK >> **wifi_password_was_here✓ SCK >> Temperature: 24.7 C
✓ SCK >> Humidity: 46.0 %
✓ SCK >> Light: 0 lx
✓ SCK >> Battery: 71.4 %
✓ SCK >> Solar Panel: 0 V
✓ SCK >> Carbon Oxide: 92206.336 kOhm
✓ SCK >> Nitrogen Dioxide: 4.974 kOhm
✓ SCK >> Noise: 56.49 dB
✓ SCK >> Wifi Spots: 0
✓ SCK >> UTC: 2000-00-00 00:00:00
✓ SCK >> *******************
✓ SCK >> Temperature: 24.8 C
✓ SCK >> Humidity: 45.7 %
✓ SCK >> Light: 35.4 lx
✓ SCK >> …

Currently the setup screen reports:

✓ Please reset your kit
✓ Press the reset button or switch it off-on.
✓ Select your kit Serial Port
✓ And click Start process…
✓ Your kit is a:
✓ SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
✓ Your kit is running 0.9.4 firmware.
✓ This is the latest version.
✓ You can skip the firmware update!
✓ SCK >> Update Fail.
✓ Your kit is connected to WI-Fi!
✓ SCK >> SCK Connected to Wi-Fi!!
✓ Your kit has updated his clock!
✓ SCK >> RTC Updated!!
✓ SCK >> Error in connection!! Data saved in memory
✓ SCK >> Pending updates: 123
✓ SCK >> *******************
✓ SCK >> Temperature: 25908 C RAW
✓ SCK >> Humidity: 32412 % RAW
✓ SCK >> Light: 109.90 lx
✓ SCK >> Battery: 100.00 %
✓ SCK >> Solar Panel: 0 mV
✓ SCK >> Carbon Monxide: 0.00 kOhm
✓ SCK >> Nitrogen Dioxide: 26.09 kOhm
✓ SCK >> Noise: 0 mV
✓ SCK >> Wifi Spots: 0
✓ SCK >> UTC: 2018-10-29 15:36:38
✓ SCK >> *******************

So it is caching data locally instead of sending it up to the website. And it doesn’t like its Internet connection, although it does connect.

What must it be able to talk to, and on what ports? This is not in the documentation.

It does however hint: ‘Your firewall is blocking the mac address of your SCK’ but that is vague- what ports does it need open outbound or inbound to send the MAC? Surely it is a PUT request from the sensor over TCP:80 or 443? If it is from the Chrome client, that would work too.

P.S.
After moving to the 0.94 firmware, this log changes to:

✓ SCK >> *******************
✓ SCK >> Temperature: ✓ SCK >> Memory limit exceeded!!
✓ SCK >> Error in connection!! Data saved in memory
✓ SCK >> Pending updates: 572
✓ SCK >> **********✓ SCK >> Memory limit exceeded!!
✓ SCK >> Error in connection!! Data saved in memory
✓ SCK >> Pending updates: 572
✓ SCK >> *******✓ SCK >> Memory limit e✓ SCK >> xceeded!!
✓ SCK >> Error in conn✓ SCK >> ection!! Data saved in m✓ SCK >> emory
✓ SCK >> Pending updates:✓ SCK >> Memory limit exceeded!!
✓ SCK >> Error in connection!! Data saved in memory
✓ SCK >> Pending updates: 572
✓ SCK >> *******************

At 100 updates, the text responses were fine. Now, errors are appearing like confetti in the babelfish terminal!

Restarting the sensor isn’t helping with the errors, so I inserted a new TF card to see if it would write the logs to that in the meantime. But alas, no difference. Then found the heading in the doc that says it is an extra feature that needs to be added manually.

Anyone have any ideas on what else to try? How to get the data published?

I tried re-installing the firmware.

✓ And click Start process…
✓ Your kit is a:
✓ SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
✓ Your kit is running 0.9.4 firmware.
✓ This is the latest version.
✓ You can skip the firmware update!
✓ SCK >> Update Fail.

Around here, I clicked ‘Reinstall firmware’ and pressed the reset button twice as prompted.

✓ Starting the flashing process…
✓ Waiting for the kit to respond…
✓ This is taking to long!!!
✓ If you haven’t yet,
Try double tapping your kit reset button.
Firmware uploaded!
✓ Clearing eeprom memory
✓ Please wait a moment…
✓ Still working, looking for older firmware…
Firmware update failed!
✓ Unrecognized error: true
✓ Please contact Smart Citizen support

Uh-oh!

OK, so rafter an on/off and reload of the page, restarting the extension app (this is now my standard procedure), the log looks healthier:

✓ SCK >> RTC Updated!!
✓ SCK >> *******************
✓ SCK >> Temperature: 28560 C RAW
✓ SCK >> Humidity: 27500 % RAW
✓ SCK >> Light: 46.90 lx
✓ SCK >> Battery: 100.00 %
✓ SCK >> Solar Panel: 0 mV
✓ SCK >> Carbon Monxide: -1486223.87 kOhm
✓ SCK >> Nitrogen Dioxide:
✓ SCK >> *******************

No complaints about storage space now. But, no mention of WiFi, and I can’t see from the lights if its associated. But it won’t ping, and dhcpd on the router reports the sensor host as offline.

So reload page, restart extension, and restart sensor. Sensor is now online!

✓ Please reset your kit
✓ Press the reset button or switch it off-on.
✓ Select your kit Serial Port
✓ And click Start process…
✓ Your kit is a:
✓ SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
✓ Your kit is running 0.9.4 firmware.
✓ This is the latest version.
✓ You can skip the firmware update!
✓ SCK >> SCK Connec✓ SCK >> ted to Wi-Fi!!
✓ Your kit has updated his clock!
✓ SCK >> RTC Updated!!

Info now stops updating in babelfish. Not sure what the next step is. Am I done? Or is there another step? Tried many times to press the save button at the top. Not sure if that is necessary or it the process has just stopped.

Often this pops up:
To configure your kit you will need to install the Smart Citizen Kit App for ChromeAdd to Chrome You can also install it manually from the Chrome store and refresh the page.

Port /dev/cu.Bluetooth-Incoming-PortSmart Citizen (Port: /dev/cu.usbmodem1421)

Makes the user think the extension instance is no longer working. But it probably is… anyhow…

My guess is that the SCK is working, but the site is not accepting the data. So one last re-flash, and instead of looking for verification in the babelfish terminal, I’ll rely on seeing the outbound traffic at the wifi network’s gateway.

Starting the flashing process…
✓ Waiting for the kit to respond…
✓ This is taking to long!!!
✓ If you haven’t yet,
Try double tapping your kit reset button.
Firmware uploaded!
✓ Clearing eeprom memory
✓ Please wait a moment…
✓ Your kit is a:
✓ SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
✓ Your kit is running 0.9.4 firmware.
✓ This is the latest version.
✓ You can skip the firmware update!

Which didn’t work wither, as it only makes internet requests when booting and resetting. Maybe I will create a SSID without any encryption- see if it is my 17 char wpa2 that is failing.

OK, so now I am watching the firewall logging every outbound packet from the SCK. (All are allowed to ANY). On resetting the SCK, no data is seen. Only when setting the wifi config oin the babelfish terminal, does the SCK start talking to the network; one UDP packet to 255.255.255.255:55555.

After a reboot, this is the babelfish output:
✓ Your kit is a:
✓ SmartCitizen Ambient Kit 1.1 - “Kickstarter Board”
✓ Your kit is running 0.9.4 firmware.
✓ This is the latest version.
✓ You can skip the firmware update!
✓ SCK >> Wifi c✓ SCK >> onection failed!!! Usin✓ SCK >> Wifi conectio✓ SCK >> n failed!!! Using ssid✓ SCK >> : and pass:
✓ SCK >> Try r✓ SCK >> estarting your kit!!
✓ SCK >> Wifi conection f✓ SCK >> Wifi conection failed!✓ SCK >>!! Using ssid: and ✓ SCK >> pass:
✓ SCK >> Try restarting ✓ SCK >> Wifi conectio✓ SCK >> n failed!!! Using ssid✓ SCK >> : and pass:
✓ SCK >> Try ✓ SCK >> restarting your kit!!
✓ Saving wi-fy network settings…
✓ Update interval haven’t change!
Settings synced!
For your kit to work properly
Please push the RESET button or simply turn your kit ON/OFF
✓ Your kit has updated his clock!
✓ SCK >> RTC Updated!!

But turn it off and on again, the terminal reports:
✓ SCK >> SCK Connected to ✓ SCK >> Wi-Fi!!
✓ SCK >> SCK Connected to W✓ SCK >> i-Fi!!

At the gateway, another UDP packet goes to 255.255.255.255:55555. Then a TCP:S call home to 198.175.253.161:21, and after 1:22, another UDP packet to 255.255.255.255:55555

Then silence. Nothing more.
After writing that, I noticed the activity LEDs went out completely. Only the green power LED is lit.

So I change the Number of Posts setting, and try to ‘Sync settings’ to waken the SCK.

After some minutes, babelfish responds:

✓ Wi-fy networks haven’t changed!
✓ Saving update interval settings…
We can’t open the serial port!!!
✓ Make sure no application is using the serial port (ex. Arduino IDE)
✓ Please try reloading this page
✓ And resetting your kit.
✓ Sync failed… please try again

So exited the extension app. Re-launched it. Restart the SCK.
✓ SCK >>; SCK Connec✓ SCK >> ted to Wi-Fi!!
✓ SCK >> Update Fail.
✓ SCK >> RTC Upd✓ SCK >> ate Failed!!
✓ SCK >> RTC✓ SCK >> Updated!!

And the usual two log entries show in the firewall a few seconds after powering on, then another after 2m.

Then after a flurry or blue and orange during booting, one blinking orange LED, and no traffic via the WAN

Another hard reset;
✓ SCK >> U✓ SCK >> pdate Fail.
✓ SCK >> RTC Update Fail✓ SCK >> ed!!
✓ SCK >> RTC no✓ SCK >> RTC Update

Maybe the RTC Update is the TCP:21 request to MICROC, coming from the WiFi interface itself. I doubt it comes from the Arduino ROM as it happens within 3s of power up

Anyhow, that’s enough, I’m fed up. Less sure that manually getting this device online is going to work now