A remote device (sensor) is sending measurements (that I get in JSON format) to a given URL and is sending new measurements (data points) every couple of minutes. I cannot share the URL but the originating sensor is an air quality sensor (see https://www.purpleair.com/map?589048#11/18.0825/-67.039, as an example; note that the data I am getting is NOT the same as this example). Here is an example of data that I am getting at the URL:

Received events: {"dewpoint":11.11,"pm2.5_A_outside":60.09,"lon":-122.012161,"pm10.0_B_outside":13.12,"pm2.5_B_outside":7.38,"pm10.0_A_outside":61.73,"sensorType":"2.0+OPENLOG+15802 MB+DS3231+BME280+PMSX003-B+PMSX003-A","temperature":18.89,"humidity":60.0,"pm10.0_B_inside":13.12,"pm10.0_A_inside":54.8,"firmwareVersion":"4.02","lat":37.375938,"timestamp":"2019-07-15T06:57:18.000+0000","pm1.0_A_inside":37.11,"pm1.0_B_inside":4.77,"statementName":"PurpleAirStatement","rssi":-50.0,"pm1.0_B_outside":4.77,"pressure":1017.13,"pm1.0_A_outside":56.42,"SID":"71b6b542-d75c-4b8e-b947-fc6603496b78","uptime":null,"_headers":null,"macAddress":"84:f3:eb:6e:b3:c4","pm2.5_B_inside":7.38,"pm2.5_A_inside":45.58}

A new record (like this one) is added to the bottom every 2 minutes or so

How do I import this streaming data into Mathematica. Here is the output I get from URLExecute[url]:

Websocket not connected - no realtime data will be shown! 

Websocket connected 
 Realtime data  

Received events: 


On the webpage after "Received events" data starts to come in (as in the example above), but i don't know how to capture it

  • $\begingroup$ Can you provide an URL that behaves the way your server does? Can you share the code you are using to connect, including your URLExecute call? Put yourself in the position of somebody trying to help you. What information would you need to reproduce your problem and find a solution? That, YOU should provide in the question. Please edit your question and add more context. $\endgroup$ – rhermans Jul 11 '19 at 9:30
  • $\begingroup$ And BTW, welcome to Mma.SE. Start by taking the tour now and learning about asking and what's on-topic. Always edit if improvable, show due diligence, give brief context, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. The site depends on participation, as you receive give back: vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. $\endgroup$ – rhermans Jul 11 '19 at 9:32
  • $\begingroup$ Thanks! I edited my question. As I indicated, I am not able to share the URL but hopefully the additional info is useful in providing an answer. $\endgroup$ – user66518 Jul 15 '19 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.