AirGradient Forum

Access data through USB interface?

Is there a way to access the Airgradient One data through its USB-C interface? some sort of USB networking, or serial link or something?

For those who dislike wifi :smiley: and/or who prefer such type of setup?

1 Like

Hi @gabu, it is currently possible to access AirGradient ONE and Open Air’s readings via USB log. The data is human-readable. You’ll see the monitor update its raw readings every 6 seconds approximately. Like what is shown below. However, this way (USB log) is primarily intended to be used as a diagnostic tool, so I am not sure about the practical feasibility in your specific use case. We still need Wi-Fi to access the monitor’s local API.

[13:44:22]WiFi RSSI -36
[13:44:22]
[13:44:22]CO2 = 531.33 ppm
[13:44:22]Temperature = 27.97 C
[13:44:22]Relative Humidity = 52.75
[13:44:22]TVOC Index = 106.0
[13:44:22]TVOC Raw = 32311.8
[13:44:22]NOx Index = 1.0
[13:44:22]NOx Raw = 16281.6
[13:44:22][1] Atmospheric PM 1.0 = 2.33 ug/m3
[13:44:22][1] Atmospheric PM 2.5 = 5.67 ug/m3
[13:44:22][1] Atmospheric PM 10 = 6.50 ug/m3
[13:44:22][1] Standard Particle PM 1.0 = 2.33 ug/m3
[13:44:22][1] Standard Particle PM 2.5 = 5.67 ug/m3
[13:44:22][1] Standard Particle PM 10 = 6.50 ug/m3
[13:44:22][1] Particle Count 0.3 = 476.0
[13:44:22][1] Particle Count 0.5 = 366.3
[13:44:22][1] Particle Count 1.0 = 67.0
[13:44:22][1] Particle Count 2.5 = 3.7
[13:44:22][1] Particle Count 5.0 = 1.7
[13:44:22][1] Particle Count 10 = 0.0
[13:44:22]
[13:44:28]External watchdog feed!
[13:44:28]
[13:44:28]CO2 = 531.67 ppm
[13:44:28]Temperature = 27.97 C
[13:44:28]Relative Humidity = 52.64
[13:44:28]TVOC Index = 106.0
[13:44:28]TVOC Raw = 32336.2
[13:44:28]NOx Index = 1.0
[13:44:28]NOx Raw = 16277.9
[13:44:28][1] Atmospheric PM 1.0 = 2.67 ug/m3
[13:44:28][1] Atmospheric PM 2.5 = 6.17 ug/m3
[13:44:28][1] Atmospheric PM 10 = 7.17 ug/m3
[13:44:28][1] Standard Particle PM 1.0 = 2.67 ug/m3
[13:44:28][1] Standard Particle PM 2.5 = 6.17 ug/m3
[13:44:28][1] Standard Particle PM 10 = 7.17 ug/m3
[13:44:28][1] Particle Count 0.3 = 478.7
[13:44:28][1] Particle Count 0.5 = 398.2
[13:44:28][1] Particle Count 1.0 = 97.2
[13:44:28][1] Particle Count 2.5 = 1.7
[13:44:28][1] Particle Count 5.0 = 1.3
[13:44:28][1] Particle Count 10 = 0.3

1 Like

Oh excellent! I didnt think of just
cat /dev/ttyACM0!

Thanks!

1 Like

@gabu, my very pleasure.

Also, please feel free to share your approach (if you’d like) on this USB reading. We are always interested in seeing something new or experimental!

Well my idea was to not use WiFi at all, as it is not an essential part of my personal infrastructure (call me “ol’fashioned” but i like me good’ol’cables! ;)) )…

So it got me thinking: what if (through an option or clever reconfiguration… or maybe i could attempt one day to modify the firmware in that direction) the /dev/ttyACM0 could, instead of these debug info, output the exact same data as the prometheus output on /metrics ? or (again through configuration option) any other form of the data as required by such or such integrated software, such as currently accessible through the local webserver?

This would potentially allow for more simpler offline configurations like the one i am aiming at?

(would also allow for relatively simple, autonomous and offline portable solutions based on the One, that could move from place to place without needing to be re-associated with different WiFi networks…)

2 Likes

Wired ethernet connectivity with POE power should be a mandatory feature, with WiFi as an option as well.

1 Like

Thank you for your suggestions @gabu @tadawson !

Do you think Ethernet with PoE should be in both indoor and outdoor monitors, or which one do you think will gain the benefit of having Ethernet with PoE more?

Outdoor monitor
I would like to see ethernet + POE as an option for the outdoor monitor as this gives more flexibility for positioning the monitor. The monitor will always need a cable for power, but its position is limited by having a mains supply or other nearby for the outdoor PSU.
Ethernet + POE overcomes this as it means that the outdoor monitor can be positioned anywhere (within the constraints of the length of cable that can be used) and still get a perfect wifi connection.

Indoor monitor
Whilst useful to have, I’m not so bothered about Ethernet + POE for the indoor monitor.
I would still like the monitor to have the wifi interface, and an ethernet only (with or without POE) connection could be useful.

1 Like

Both. No matter how you use it, you are running a cable. The option to remove the bogosities of WiFi and power the monitor is a big plus in either case, although I do suspect that outdoor would be more likely to use this solution.

2 Likes

maybe POE could have its dedicated thread?

1 Like

Thanks all for your input!

If you have any ideas to suggest any features, please feel free to create a thread. I’m looking forward to discussing the interesting ideas you have!

so to summarize and re-formulate my proposal, after a few days of playing with the Airgradient One, and exploring a few ways of using it as a reliable data-source is the following:

  • WiFi is a bit of a problem for me, not something i consider reliable and/or that i want to be using all the time;
  • I can imagine mobile configuration where I would use the device accross zones and networks, sometimes without necessarily even having access;
  • given how flexible is the wifi interface with its webserver in terms of multiplicity of formats for datasource endpoints/urls:

=> I think the USB data link should be used as one more interface, on par with the WiFi one, and that this could be done with probably minimal amount of additional code:

  • add one option in the settings to chose which format/endpoint the USB should be used as (“debug” standard, “prometheus”, "home assistant, “apple blah”, etc. as in: chose one of the multiple URLs served by the webserver)
  • mirror existing code that produces such output in the place of current existing USB loop.

==> let users find new usages, new configurations, etc. with these settings, that could greatly help with the upcoming mobile units (and would give potential for more unification of usage between the indoors/outdoors/mobile units.)

(and yes, the same could apply to PoE if it ever was considered as an addition to the hardware :grinning:)

1 Like

Thanks for your advice, @gabu! Your input is very valuable.

Could you please elaborate more and give some examples of this:

  • I can imagine mobile configuration where I would use the device accross zones and networks, sometimes without necessarily even having access;

Thank you in advance!

I would see myself for instance having the Airgradient One attached to a self-powered device that would just run prometheus or something similar for data protection, that would share its power with the AgOne, and move accross my building, from floor to floor, apartment to apartment for -say- 10minutes each, to do measures at a given time, and be able to compare if some setting, some activity in one place, has an impact on the other places…

Or on the range of a huge conference center, where there isnt even wifi coverage everywhere, going from place to place and map measurements along with GPS or accelerometer tracks for instance…

Or in a old house, which has diffeernt floors, not all of them covered by Wifi, but that may have very different measures of humidity, VOCs, etc.

=> all to do local/offline recordings of measurements from the AgOne, without needing to reset the device and associate it to various wifi networks along the way (especially if in some such places there isn’t a wifi network)

=> basically to be able to measure where there is no wifi network (i know it may sound strange to some people, but such places exist! ;))) )

1 Like

That’s an interesting idea anyway!

Some features that you mentioned (GPS and accelerometer) are included in the new AirGradient Go. It uses BLE to communicate with a receiver device (e.g., a smartphone). Do you think BLE (which doesn’t require a Wi-Fi connection) is acceptable, or do you think the wired connection (like USB) is still preferable in your use case?

Hey thanks for your interest and the follow-up!

So my personal case doesn’t represent anyone but me, but:

1/ i just bought an Airgradient One and i for sure won’t have the budget for your extraordinary mobile device when it gets shipped.

2/ I do not trust bluetooth/BLE more than Wifi. I just dislike it, based on an experience where “weird things happen” with BT, especially from the gnu/linux stack. things sometimes get de-associated, become slow/janky, are hard to diagnose, but also would require a push of a button (while sometimes you connect to a system remotely and cannot do that…), etc.
=> in general they have more “moving parts” than a good’ol cable, that’s my philosophy, especially when i design systems to be sturdy, durable and to work unattended for a while.

3/ it’s more opportunistic thinking about your architecture: your device have several “interfaces” (wifi / USB for the AgOne, BT / USB for the upcoming portable one, etc.), and you already have embedded code that translates sensors’ data in many useful outputs/format/endpoints
=> so in order to maximize potential usages, all interfaces could be serving all possible types of formats/endpoints.

I think beyond my preference it’s about enabling as many usages as possible (“because we can”), even the ones you have yet no idea about, and trust the user to find what to do with these many possibilities! :wink:

1 Like

Hi @gabu, thanks a lot again for your interesting view!

Yes, I can relate to what you experience about a Bluetooth mouse, as I have an old Ubuntu laptop, and I have to turn off and on my Logitech mouse every time it boots (the laptop won’t connect to the mouse automatically (there could be a way to solve this, but I’ve not tried maybe)).

Anyway, regarding the feature for the AirGradient ONE, I’ll definitely discuss this with the team. While I cannot make a solid promise on your feature request, as we need to make sure that there is a reasonable number of users who need it, and how practical we can implement and maintain the feature (I know you understand this). I’d like to say (personally again) that I always love the concept of utilizing, or sometimes, just an experiment, to prove that we can do something with our electronics, just like you mentioned that the reason we should try something is ‘why not?’.

1 Like