Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By darko1984
#54866 Hi guys,

i have a question for you..
I'have developed code to decode weather data from a weather station(wind,rain,temperature,solar radiation) that send packet at 433mhz.
I'm using a 433mhz rx and an arduino nano,it works perfectly,after i receive the data,i send it to the hardware serial monitor ,so i can read data from serial console
of arduino ide.
Now,i would like to send this data to a server using an esp8266.
Is it possible send data from hardware serial monitor of arduino,to internet,using esp8266-01?
Could you pease give me some hints?Thank you guys!

This is the code that i'm using to send data so hardware serial monitor.

Code: Select all#ifdef SERIALOG
void SerialWrite(byte bSensorType)
{
  byte b_ch;
  switch(bSensorType)
  {
  case 0: //temp
    {
      b_ch=(bICP_DEA_PacketData[bICP_WSR_PacketOutputPointer][4] & 0x0C) >> 2;
      Serial.print(b_ch,DEC );
      Serial.print(" ");
      Serial.print(W_Packet.Temp[b_ch].temp/10, DEC );
      Serial.write( byte('.') );
     
      if( W_Packet.Temp[b_ch].temp < 0 )
      Serial.print(((0-W_Packet.Temp[b_ch].temp)%10), DEC );
      else
      Serial.print( W_Packet.Temp[b_ch].temp%10, DEC );
     
      Serial.print(" ");
      Serial.print(W_Packet.Temp[b_ch].hr, DEC );
      Serial.print(" ");
     
#ifdef BAROMETER_SENSOR
      Serial.print(pressure/100, DEC);
      Serial.write( byte('.') );
      Serial.print( pressure%100, DEC);
#endif
      Serial.println();
      break;
    }
 
  case 1: //Rain
    {
      Serial.print("4");
      Serial.print(" ");
      Serial.print(uiWSR_RainfallCount/4, DEC );
      Serial.write( byte('.') );
      Serial.print(uiWSR_RainfallCount%4, DEC );

      Serial.println();
      break;
    }
 
  case 2: //wind
    {
      if((W_Packet.isfully & 0xC0) == 0xC0)
      {
        //avg_wind
        Serial.print("2");
        Serial.print(" ");
        Serial.print( W_Packet.Wind.avg/5, DEC );
        Serial.write( byte('.') );
        Serial.print(W_Packet.Wind.avg%5, DEC );
        Serial.print(" ");
        //gust_wind
        Serial.print(W_Packet.Wind.gst/5, DEC );
        Serial.write( byte('.') );
        Serial.print(W_Packet.Wind.gst%5, DEC );
        Serial.print(" ");
        //wind_dir
        Serial.print(W_Packet.Wind.dir);
        Serial.println();
      }
      break;
    }
 
  case 3: //SolarRadiation
    {
      if((W_Packet.SolarRad<18000) && (bWSR_StationTransmitterID == 156))
      {
        Serial.print( "StationID=" );
        Serial.print( bWSR_StationTransmitterID, DEC );
        Serial.print(",Solar Radiation=");
        Serial.print( W_Packet.SolarRad/10, DEC );
        Serial.write( byte('.') );
        Serial.print( W_Packet.SolarRad%10, DEC );
        Serial.print(" W/mq");
        Serial.println();
      }
      break;
    }
  }
}
#endif
User avatar
By darko1984
#54888
AcmeUK wrote:How do you want to send the data? UDP, HTTP Put/Post/GET, MQTT?

Have a look at this https://github.com/tuanpmt/espduino

It implements communication with the ESP from the Arduino via the serial port using SLIP protocol. The page has MQTT and REST examples.

Thanks acme!
I would like to send data with an http post and then intercept it in php,saving the record to a mysql database!
I Will check espduino and let you know ;)