<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Missing character in temp display if >199F]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1396&amp;type=atom" />
	<updated>2021-10-02T22:48:27Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1396</id>
		<entry>
			<title type="html"><![CDATA[Re: Missing character in temp display if >199F]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4289#p4289" />
			<content type="html"><![CDATA[<p>PS, it is much better to properly format your code when posting here... use the <strong>&lt;&gt;</strong> icon in the editor.</p>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-10-02T22:48:27Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4289#p4289</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing character in temp display if >199F]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4288#p4288" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>corey.mugaas wrote:</cite><blockquote><p>&nbsp; dtostrf(TempRawData, 0, 0, RemoteXY.temp_1);</p></blockquote></div><p>Have you tried adjusting the string length and possibly buffer?</p><p>dtostrf(<strong>floatvar, StringLengthIncDecimalPoint, numVarsAfterDecimal, charbuf</strong>);</p><p>where:</p><p><strong>floatvar </strong>=&nbsp; &nbsp; float variable<br /><strong>StringLengthIncDecimalPoint</strong> = This is the length of the string that will be created<br /><strong>numVarsAfterDecimal </strong>= The number of digits after the deimal point to print<br /><strong>charbuf </strong>= the array to store the results</p><p>Also, is the display element large enough to accommodate all the digits?</p>]]></content>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-10-02T21:22:21Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4288#p4288</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Missing character in temp display if >199F]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=4287#p4287" />
			<content type="html"><![CDATA[<p>Hi Everyone,</p><p>I am working on an engine temperature monitor using ESP8266-12E node mcu, three DS18B20 sensors on a One Wire interface, and RemoteXY to my iphone.</p><p>When any temp sensor goes over 199 degrees F the last character is occasionally missing... for example the display reads 199 then exactly at 200 the display reads &quot;20&quot; not &quot;200&quot;. At 201F then it reads &quot;201&quot; and so on with an occasional lost last character.</p><p>I have confirmed via serial monitor that the esp8266 is in fact reading the correct temperature. Is it possible that the dtostrf is losing the last digit when converting to a string?</p><p>The behavior is the same whether I build this gadget with an ESP/wifi or Arduino Nano and a dsd-tech ble transceiver or only one temp sensor or three.</p><p>Thanks for your help!</p><p>/*<br />&nbsp; &nbsp;-- Corey Mugaas 2021<br />&nbsp; &nbsp;uses esp8266 nodemcu wifi, temp sensor DS18B20, &amp; displays temp on RemoteXY iOS app<br />*/</p><p>//////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; RemoteXY include library&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />//////////////////////////////////////////////</p><p>// RemoteXY select connection mode and include library <br />#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT<br />#include &lt;ESP8266WiFi.h&gt;<br />#include &lt;SoftwareSerial.h&gt;<br />#include&lt;OneWire.h&gt;<br />#include&lt;DallasTemperature.h&gt;<br />#include &lt;RemoteXY.h&gt;</p><p>// RemoteXY connection settings <br />#define REMOTEXY_WIFI_SSID &quot;Engine Monitor&quot;<br />#define REMOTEXY_WIFI_PASSWORD &quot;&quot;<br />#define REMOTEXY_SERVER_PORT 6377</p><br /><p>// RemoteXY configuration, olive green background<br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =<br />&nbsp; { 255,0,0,7,0,31,0,13,103,0,<br />&nbsp; 67,5,19,28,59,33,85,103,7,129,<br />&nbsp; 0,30,20,36,6,85,84,101,109,112,<br />&nbsp; 101,114,97,116,117,114,101,0 };<br />&nbsp; <br />// this structure defines all the variables and events of your control interface <br />struct {</p><p>&nbsp; &nbsp; // output variables<br /> char temp_1[7];&nbsp; // string UTF8 end zero&nbsp; <br />&nbsp; &nbsp;</p><p>&nbsp; &nbsp; // other variable<br />&nbsp; uint8_t connect_flag;&nbsp; // =1 if wire connected, else =0 </p><p>} RemoteXY;<br />#pragma pack(pop)</p><p>/////////////////////////////////////////////<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END RemoteXY include&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //<br />/////////////////////////////////////////////</p><p>// <br />//</p><p>// Setup a oneWire instance to communicate with any oneWire devices on pin 7<br />#define ONE_WIRE_BUS D2</p><p>// Pass oneWire reference to Dallas Temperature<br />OneWire oneWire (ONE_WIRE_BUS);<br />DallasTemperature sensors(&amp;oneWire);</p><br /><p>// Assign sensor name to individual sensor address</p><p>DeviceAddress Temp_1 = { 0x28, 0xFF, 0xD2, 0xFB, 0xAE, 0x20, 0x04, 0xD2 };</p><br /><p>void setup() </p><br /><p>{<br />&nbsp; RemoteXY_Init (); <br />&nbsp; <br />&nbsp; <br />&nbsp; // TODO you setup code<br /> // start sensors<br />&nbsp; sensors.begin();<br />&nbsp; Serial.begin(115200);</p><p>&nbsp; </p><p>&nbsp; // set sensor resolution to 10 bit<br />&nbsp; <br />&nbsp; sensors.setResolution(Temp_1, 9);<br />&nbsp; &nbsp;<br />}</p><p>void loop() </p><br /><p>{ <br />&nbsp; RemoteXY_Handler ();<br />&nbsp; <br />&nbsp; <br />&nbsp; // TODO you loop code<br />&nbsp; // use the RemoteXY structure for data transfer<br />&nbsp; // do not call delay() <br />&nbsp; <br />// request temp data from temp senders<br /> sensors.requestTemperatures();</p><br /><br /><p>float TempRawData = sensors.getTempF(Temp_1);</p><br /><br /><p>Serial.println(TempRawData);</p><p>Serial.println();<br />Serial.println();</p><br /><br /><p>// prep data for RemoteXY<br />// convert the temperature value into a string <br />// and place it immediately in the field text_1 patterns RemoteXY </p><p>&nbsp; dtostrf(TempRawData, 0, 0, RemoteXY.temp_1);<br />&nbsp; </p><p>}</p>]]></content>
			<author>
				<name><![CDATA[corey.mugaas]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1955</uri>
			</author>
			<updated>2021-10-02T14:18:37Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=4287#p4287</id>
		</entry>
</feed>
