Forum Replies Created
-
AuthorPosts
-
DonZalmrolParticipant
Hi Radu,
Finally gotten around and I have submitted my contribution to the Github code with additional parameters and a suggestion to disable/turn off unused graphs on the monitoring dashboard.
DonZalmrolParticipantSure, how do I proceed? Just create some defines and update the github, then your team will incorporate this into the API & site? Thx!
DonZalmrolParticipantAnybody? 🙂
DonZalmrolParticipantMy 2 cents:
1. Safer
2. More precise
3. Safer
4. stable supply
5. Safer
6. Less noise from the line
7. SaferExcessive ripply will cause misreadings/ counts on your GM tube AND can harm your tube or other components.
DonZalmrolParticipantSure, I’ve send you a pm with my details.
DonZalmrolParticipantSure!
You can find my code on my GitHub page: https://github.com/DonZalmrol/GM_SI-22G_Stationary_Logger
Currently still testing it out and waiting for other parts, but all seems to be working stable for the moment.If you see things that can be improved let me know 🙂
DonZalmrolParticipantYes, intentional.
Currently awaiting the delivery of it and a LUX sensor 🙂PS: My timing issues are also resolved, it now keeps each count of both tubes in an moving average array for 60 seconds and uploads the calculated MA to uradmonitor.
DonZalmrolParticipantHi Wolferl, thanks for all the help!
I managed to get it working on my ESP32, now unit 13000212 is uploading nicely to uradmonitoring 🙂
See attached image for the result.One issue that I still need to resolve is that my timers are off with almost 5 seconds…
In short, when almost reaching 60 seconds (e.g. 55 seconds) my uploads prematurely start instead of after 60 seconds (if function set to 61).
So this means it uploads the data gathered over 55 sec. instead of 60 sec…If I comment my upload functions the timer works perfectly, its like these functions are called too soon.
Attachments:
DonZalmrolParticipantThanks! I’ll check and try it out!
DonZalmrolParticipantGot it!
16:15:32.405 -> Connection to uradmonitoring platform succeeded! 16:15:32.405 -> created EXP code = /api/v1/upload/exp/01/1621606532/02/25.10/03/0/04/32.00/0B/76/0C/406.39/0E/106/0F/123/10/6 16:15:57.899 -> Response = {"success":"ok"} 16:15:58.413 -> Connection to uradmonitoring platform Disconnected.
In my setup I may not use the CRLF as looks like it messes up the connection towards the API.
DonZalmrolParticipantHa found the following culprit ‘:’
Original:
client.sendHeader(“X-User-id:“, USER_ID);
client.sendHeader(“X-User-hash:“, USER_KEY);
client.sendHeader(“X-Device-id:“, DEVICE_ID);Changed to:
client.sendHeader("X-User-id", USER_ID); client.sendHeader("X-User-hash", USER_KEY); client.sendHeader("X-Device-id", DEVICE_ID);
In Wireshark I now see my x-headers being posted.
I still get an issue with the x-device-id, I reckon that still has to do with the number not being translated to HEX…DonZalmrolParticipantOk, I’m an idiot… looks like not x-headers are pushed at all…
Strange as it should be pushed by my httpclient.Trying to look at my code.
DonZalmrolParticipantSo If I remove the 0x from my ID it becomes 13000212, then I need to convert 13000212 to hex which should be C65E14 (Hex number) or 00C65E14 (Hex signed 2’s complement) correct?
Bit odd when I use Postman to test the x-headers with just the number 13000212 it works and data is posted.
If I add 0x or convert it to either HEX number it fails with the exact same error response:{ "error": "Invalid Device ID" }
DonZalmrolParticipantPS: Also tried with and with CRLF (\r\n).
DonZalmrolParticipantGetting a step further as the problem is currently situated in the X-headers.
21:52:28.951 -> Connection to radmon monitoring platform Disconnected. 21:52:28.951 -> Connection to uradmonitoring platform succeeded! 21:52:28.951 -> /01/1621540348/02/21.90/04/47.00/0B/60/0C/406.39/10/0x6 21:52:28.951 -> I am here now 01 21:52:31.422 -> X-User-Id:XXXX 21:52:31.422 -> 21:52:31.422 -> X-User-Hash:YYYY 21:52:31.422 -> 21:52:31.422 -> <strong>X-Device-id:0x13000212</strong> 21:52:31.422 -> 21:52:31.422 -> I am here now 02 21:52:34.401 -> I am here now 03 21:52:34.447 -> <strong>Status code: 200</strong> 21:52:34.447 -> <strong>Response: {"error":"Invalid Device ID"}</strong> 21:52:34.447 -> I am here now 04 21:52:34.918 -> I am here now 05 21:52:34.918 -> Connection to uradmonitoring platform Disconnected.
Looks like the connection get established (HTTP code = 200), my X-headers are validated, yet I receive “invalid device ID” for my device.
Tried “%08lX13000212″,”0x13000212” and “13000212”.
My current code:
// URadMonitoring credentials const char *USER_ID = "XXXX\r\n"; const char *USER_KEY = "YYYY\r\n"; const char *DEVICE_ID = "13000212\r\n"; ... minimized code ... // Upload data to the uradmonitor.com server void connecToURadMonLogger() { WiFiClient wifi; HttpClient client = HttpClient(wifi, "data.uradmonitor.com", 80); Serial.println(F("Connection to uradmonitoring platform succeeded!")); // Get current time as UNIX time time_t epoch = pftime::time(nullptr); // Concat data for POST String ptr = "/01/"; // compulsory: local time in seconds ptr += epoch; // time epoch value ptr += "/02/"; // 02 = optional: temperature in degrees celsius ptr += dht.getTemperature(); // temperature value ptr += "/04/"; // 04 = optional: humidity as relative humidity in percentage % ptr += dht.getHumidity(); // humidity value ptr += "/0B/"; // 0B = optional: radiation measured on geiger tube in cpm ptr += totalCount_3; // a-cpm value ptr += "/0C/"; // 0C = optional: high voltage geiger tube inverter voltage in volts ptr += displayTubeVoltage(); // tube voltage value ptr += "/10/0x6"; // 10 = Tube ID | 0x6 = GEIGER_TUBE_SI22G // Test output Serial.println(ptr); Serial.println(F("I am here now 01")); client.beginRequest(); client.post("/api/v1/upload/exp"); client.sendHeader("Content-Type", "application/x-www-form-urlencoded"); client.sendHeader("Content-Length", ptr.length()); client.sendHeader("X-User-Id:", String(USER_ID)); client.sendHeader("X-User-Hash:", String(USER_KEY)); client.sendHeader("X-Device-id:", String(DEVICE_ID)); client.beginBody(); client.print(ptr); client.endRequest(); Serial.println("X-User-Id:" + String(USER_ID)); Serial.println("X-User-Hash:" + String(USER_KEY)); Serial.println("X-Device-id:" + String(DEVICE_ID)); Serial.println(F("I am here now 02")); // read the status code and body of the response int statusCode = client.responseStatusCode(); String response = client.responseBody(); Serial.println(F("I am here now 03")); Serial.print("Status code: "); Serial.println(statusCode); Serial.print("Response: "); Serial.println(response); Serial.println(F("I am here now 04")); uploadOk = true; retry = 0; // 5 blinks for 50 ms blinkLedUpload(5, 50); //client.flush(); // Flush connection //client.stop(); // Stop client //delay(5);// Give some time to stop Serial.println(F("I am here now 05")); Serial.println(F("Connection to uradmonitoring platform Disconnected.")); }
Wireshark is not yet possible as my device is in a secured vlan.
-
AuthorPosts