Need Code for ESP32

More
4 years 8 months ago #5628 by Rotter
Need Code for ESP32 was created by Rotter
Hello,
first, I searched the forum and the web but did not found what I'm looking for....

I have the Geiger Kit from Bang... and connected it to a ESP32 TTGO with with Display.
I made some code to show the measurement on the display and send it via WiFi to my RPI (Mosquitto running).
Now I want to upload the Data to Radmon as well.
My problem is the connection. Can I "open a second WiFi connection" for Radmon (The one for my local net should stay established).
Can anybody provide some code snippest, please?

Thanks in advance,
Ingo

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #5629 by Simomax
Replied by Simomax on topic Need Code for ESP32
Hi Ingo,

Welcome!
I'm not sure that there is any ESP32 code for Radmon, however there is some arduino code that may work as a starting point for you. Look on the software page and scroll down to the 'arduino' section: https://radmon.org/index.php/software

If you have already got your ESP32 work with your counter and display the current CPM then you are almost there. All that Radmon requires is for the current username/password and CPM value to be sent so you may need to either write new code to do so, or edit the arduino code to suit the libraries you are using on your ESP32.

This is the arduino code from the 'software' page:

#include <SPI.h>
#include <Ethernet.h>

Arrays and object definitions

byte mac[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }; // MAC ADDRESS OF YOUR ETHERNET ADAPTOR
IPAddress ip(192,168,0,5); // YOUR IP
IPAddress server(80.229.27.195); // RADMON.ORG IP, CHECK THIS
EthernetClient client;

Procedure to init

void init_ethernet()
{
// give the ethernet shield a second to initialize:
delay(1000);
Ethernet.begin(mac, ip);
delay(1000);
}

Procedure to send CPM value to radmon

void connect()
{
if (client.connect(server, 80))
{
client.print("GET /radmon.php?function=submit&user=");
client.print(UserName); client.print("&password=");
client.print(PassWord); client.print("&value=");
client.print(int(f_value[CPM]));
client.print("&unit=CPM");
client.println(" HTTP/1.0");
client.println("HOST: radmon.org");
client.println();
}
else
{ // you didn't get a connection to the server: }
}

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #5630 by Rotter
Replied by Rotter on topic Need Code for ESP32
Thanks Simomax, I have seen this example. I was just thinking that there must be some code out there which does nearly what I wanna do. But if there isn't, I will try to figure it out with the example above.
Thanks

Please Log in or Create an account to join the conversation.

Moderators: Gamma-Man
Time to create page: 0.127 seconds
Powered by Kunena Forum
Everything's free. Please support us by considering a donation. Log in first!
Solar powered Raspberry Pi 4 server stats: CPU 29% Memory 14% Swap 17% CPU temp=50.6'C Uptime 9 Days