ppyordanov / Dynamic-Noise-and-Pollution-Map

A dynamically generated University of Glasgow noise and pollution campus map via the innovative Smart Citizen Kit developed in Barcelona, Spain by FabLab.
0 stars 0 forks source link

SCK Team Correspondence #35

Closed ppyordanov closed 9 years ago

ppyordanov commented 9 years ago

Here will be posted all the correspondence with the Smart Citizen Kit Team, working at Fab Labs, Barcelona.

/posting such information does not cause ethical issues as it does not contain any personal information and the SCK developers know that it is going to be used for research/ software engineering purposes; if necessary, explicit consent can/ will be obtained before this repository is made public/

_ORDER: OLDEST -> MOST RECENT_

ppyordanov commented 9 years ago
Reflection of initial issues with the kit:

Hello,

I am using the Smart Citizen Kit for my fourth year project at the University of Glasgow. I seem to have some issues with the deployment of the device.

It took some time but after a couple of hours I finally managed to successfully configure the kit and manually upload the latest firmware version (Arduino IDE would freeze on Windows and not recognize the COM port correctly, however, worked on Ubuntu without any issues). Now that I have registered the kit's MAC address and uploaded the network settings I am getting the following feedback in the serial monitor:

"..


Temperature: 26188 C RAW Humidity: 30352 % RAW Light: 39.60 lx Battery: 100.00 % Solar Panel: 0 mV Carbon Monxide: 204.36 kOhm Nitrogen Dioxide: 16.04 kOhm Noise: 112 mV Wifi Spots: 0 UTC: 2000-01-01 00:36:05


"

Can you help me to resolve this issue?

Kind regards,

Petar Yordanov.

Response from the SCK team:

Hi Peter,

Sorry for the late response. I hope you are doing fine.

We are sorry to hear that you are having problems with the deployment of your SCK.

Anyway, the feedback you are getting leaves not doubt! Your kit is not getting connected to any of the wifi networks you have around you.

Have you tried the Smart Uploader on our platform!? Yesterday I configured 7 SCKs using it (see http://smartcitizen.me/users/view/19). Everything went smooth and without any issue. I am using Mac OS X 10.9.5 and Chrome v37.0.2062.124, not windows or Ubuntu but the configuration process should also work on these OS.

On the other hand, you could also use "the compilation way" (http://smartcitizen.me/posts/view/11) to configure your kit before registering it. In this way, you could know if your Wi-Fly module is working well and getting connected. If not, we should maybe check your module's status using the utilities available in github: https://github.com/fablabbcn/Smart-Citizen-Kit/tree/master/utilities

In any case, it can be also the type of wireless LAN you are trying to connect to. Are you sure your network is WPA2!?

I hope this info helps. If necessary, we could give you a hand via Skype/Hangout.

I look forward to hearing from you soon.

Kind regards, Aitor.

My Response

Hey Aitor,

Thank you very much for the response.

I actually managed to resolve the issue. After resetting the kit a few times it just woke up fine and started transmitting the data to the server.

I am very glad that you mentioned skype/hangout and in case I have more issues/questions I will get in touch.

Kind regards,

Petar Yordanov.

ppyordanov commented 9 years ago
Authentication Mechanism Question

Hello Aitor,

I am currently making plans about the implementation of the whole system and will probably need to develop a user authentication mechanism. Is it possible to integrate your authentication API from smartcitizen.me (if it is public, of course) to be able to retrieve user personal preferences and registered devices upon login?

Regards, Petar Yordanov.

SCK Team Response

Hello Petar,

concerning your question about a user authentication mechanism I think you are referring to something like oAuth, as Twitter and Facebook provide on their own APIs. This feature will be supportex on the new backend we are working that will be launched by mid 2015. At the moment your users will need to provide you with their SmartCitizen API Key when they register to your platform. Then you can use it to retrieve all the information about them and also the devices data, etc.

Will this work for you?

Thanks,

Guillem.

My Response

Hello Guillem,

I think that this will be more than enough for what I need at the moment. Thank you!

P. Yordanov.

SCK Team Response

You can see the API doc for this here:

http://api.smartcitizen.me/#api-Users-GetUserInfo

Regards,

Guillem.

ppyordanov commented 9 years ago
Question regarding issue #37

Hello again,

Thank you for the link. I have actually studied the API thoroughly and updated the latest SCK firmware version so that updates are sent to the server every 30 seconds instead of once a minute ()chhanged a single numerical value in Constants.h). However, when I try to export my data now, I see that I do not have anything in the "data" dictionary. Why is that and how can I get my data saved as before?

Regards,

Petar Yordanov.

SCK Team Response

Hello Peter,

Let's see:

Thank you for the link. I have actually studied the API thoroughly and updated the latest SCK firmware version so that updates are sent to the server every 30 seconds instead of once a minute ()chhanged a single numerical value in Constants.h). However, when I try to export my data now, I see that I do not have anything in the "data" dictionary. Why is that and how can I get my data saved as before?

When you refer to no data, do you mean you do not get any data on-line, so the kit seems offline or you refer the data download (CSV,…) is not working? We are having issues with the CSV download since a week.

Also, I guess it is possible to configure the kit so that it sends updates directly to my server instead of routing through smartcitizen.me. Would that involve many changes to the firmware?

The smartcitizen kit sends the data as a JSON string on a custom HTTP header and we do not calculate the Content-Lenght. For you to make this you will need:

https://github.com/fablabbcn/Smart-Citizen-Kit/blob/071a2e53f9cbb74a10d29c6e11718778eca19e0c/sck_beta_v0_8_6/ServerUpdate.ino#L110-L153

https://github.com/fablabbcn/Smart-Citizen-Kit/blob/071a2e53f9cbb74a10d29c6e11718778eca19e0c/sck_beta_v0_8_6/sck_beta_v0_8_6.ino#L47

As you can see it is a little bit of work.

We can try to work on it but I don't know when this could be done. Anyway as a way to start and understandt how this things work I recommend you to check any Arduino Ethernet Shield code example.

https://github.com/arduino/Arduino/blob/master/libraries/Ethernet/examples/XivelyClient/XivelyClient.ino#L102-L141

Hope this helps you,

Best,

Guillem.

ppyordanov commented 9 years ago

Comment moved here: #37

ppyordanov commented 9 years ago
Question to SCK Team

Hello Guillem,

Thank you for the detailed response. You have provided some great food for thought regarding server transmitting. I will give you more details soon.

Considering the issue I mentoned in my previous email, what I mean is that I cannot export data: csv, json, xml and what I see in the output is:


{
    "device": {
        "id": "1651",
        "user_id": "2282",
        "kit_version": "1.1",
        "macadress": "00:06:66:22:3c:2b",
        "title": "PP Yordanov's Kit",
        "description": "Testing kit.",
        "location": "Glasgow, United Kingdom",
        "city": "",
        "country": "",
        "exposure": "indoor",
        "position": "fixed",
        "elevation": "100.0",
        "geo_lat": "55.884310000000000",
        "geo_long": "-4.280606000000000",
        "created": "2014-10-01 19:13:03",
        "modified": "2014-10-04 20:25:03",
        "last_insert_datetime": "2014-11-08 14:03:43",
        "ro_co": "75000",
        "ro_no2": "10000",
        "status": "online"
    },
    "data": [
    ]
}

Notice the data list is empty. This has been going on for a couple of weeks now - is it a smartcitizen.me server issue and around when will it be resolved?

Kind regards,

Petar Yordanov.

ppyordanov commented 9 years ago
Question to SCK Team

Hello,

I have one more question. What do the values for noise, co and no2 represent. The official website is showing them as kilo Ohms if I remember correctly, i.e., fetching the sensor resistor data? Regards,

P.Yordanov.

SCK Team Response

Hello Peter,

Yes, we are not currenlty displaying ppm (parts per milion).

Instead we are showing you the actual resistance of our your sensor in KΩ, this is also known as RS.

We are still not offering PPM because we can still not ensure a perfect calibration of our sensors we are working hard on offering a calibration solution.

Anyway this doesn't mean you can not calculate PPM based on your kit's data:

Base on our own tests we consider 75KΩ to be a default R0 in our CO sensors.

Concerning your last sensor RS was 641KΩ we can calculate ppm as RS/R0 which give us around 8.3 PPM which is not a bad value.

Anyway this is based on assuming your sensor R0 and is not a trustable value.

So, this means that the data coming from your CO sensor do not make sense?

Not, really. Even though as you can see calculating PPM is a risky operation when your sensors are not calibrated the sensor is meant to offer you a tendency. Helping you understand how CO levels evolve on a week, day or month period.

Hope this helps you,

We are preparing an extended documentation concerning the gas sensors at the moment find attached the NO2 + CO sensor datasheet.

Regards,

Guillr,.

ppyordanov commented 9 years ago

This issue can be closed now.