Send over AT - INT to Float

Hello :confused: ,

I am an electrical circuit: ARD Uno + DS18B20 + IoT Sigfox TD1207. I need send data from sensor over Modul TD1207 to beckand. Data from the sensors send via AT command, but despite him not to send float data. How do i can send data through the float at a command module is processed?

Datasheet TD1207 - page 34 - https://github.com/Telecom-Design/Documentation_TD_RF_Module/raw/master/TD1207%20Reference%20Manual.pdf

Main code + library: https://gist.github.com/Kaniiisek/b0959512d83da99d6511ba0ae10a485f

#include <SoftwareSerial.h>
#include "TD1208.h"
#include <OneWire.h> 
#include <DallasTemperature.h>

#define SIGFOXMOD_TX (2)
#define SIGFOXMOD_RX (3)
#define ONE_WIRE_BUS 7


OneWire oneWire(ONE_WIRE_BUS); 
DallasTemperature sensors(&oneWire);

SoftwareSerial SigFoxSerial(SIGFOXMOD_RX, SIGFOXMOD_TX); 
 
TD1208 td1208(&SigFoxSerial);
int  TempInC;
 
void setup()
{	
  
Serial.begin(9600);
sensors.begin();


if (td1208.sendAT())
{
Serial.println("TD1207 OK");
}
else
{
Serial.println("TD1207 KO");
//while (1);
}
}

void loop()
{

sensors.requestTemperatures();
sensors.getTempCByIndex(0);  
TempInC = sensors.getTempCByIndex(0);

float temperatureInCelsius = sensors.getTempCByIndex(0);
  Serial.print("Teplota: ");
  Serial.print(temperatureInCelsius, 0);
  Serial.print(" Celsius, ");

int temperature = 0;
if (td1208.getTemperature(&temperature))

{
		
if (td1208.sendPayload((String)TempInC))
    
{
Serial.println("Poslano");
}
else
{
Serial.println("Neposlano");
}
}
else
{
Serial.println("Temperature KO");
}

while (1);
}

You are missing a SigFoxSerial.begin(xxxx); where xxxx is the baudrate of your sigfox module

The documentation states: Speed 9600 bps 8 data bits 1 stop bit No parity

Thank write-up ... You do not know how to send float data please?

A float like any other data is a set of bytes. If you know how to send a byte then you know how to send a float… you could also decide to send an ASCII representation of your float, a string of characters - but that’s the same thing, it boils down to sending a set of bytes

see the AT command [color=blue]$LD[/color] in the manual. This command sends a Data Message to the Gateway. Module type must be set to Device and a Local Register must have previously been issued for this command to be successful

The TD1208 Library you pointed at has a method to send AT commands

bool TD1208::sendATCommand(const String command, const int timeout, String *dataOut)

reading through that library they make heavy use of the String object which I think is not such a great idea, I would basically not use that library at all beyond understanding the basics of how they set up the communication and check answers

I’ll advise you read Serial Input Basics and leverage the standard C string functions
stdlib.h
string.h
and write your own small AT command sender + answer parser

Unfortunately, I still can not send data as a float. I read the foundation of communication, but it seems to me that it is not possible to appear in beckand Float value.

"see the AT command $LD in the manual. This command sends a Data Message to the Gateway. Module type must be set to Device and a Local Register must have previously been issued for this command to be successful" - I do not understand that.

Please help me regaling float values, I have a lot of bad.

Unfortunately, I still can not send data as a float.

Nor do you seem to be able to post code that shows what you tried.

You can use dtostrf() to convert a float to a string.