<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Projects made with RemoteXY]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;fid=10&amp;type=atom" />
	<updated>2026-02-07T15:35:53Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/index.php</id>
		<entry>
			<title type="html"><![CDATA[HP Meter Buddy]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=2117&amp;action=new" />
			<summary type="html"><![CDATA[<p><a target="_blank" href="https://remotexy.com/en/editor/3c355a433e76024ad0a9173199ca9f5c/">https://remotexy.com/en/editor/3c355a43 … 199ca9f5c/</a></p><p>This is a project to read data from the HP/Agilent 34401A multimeter and perform 3 main functions:</p><p>1) Display the raw meter data, because my meter&#039;s display can be intermittent.</p><p>2) Display current shunt readings in actual amps.</p><p>3) Graph and record meter readings as part of my burn-in process after repairs and calibrations.</p><p>Getting the data from this meter is a real pain (for me) via SCPI, so when I found that GPIB address 31 was a constant stream of raw meter data on the RS232 line, I was intrigued. I figured out how to read this data on my PC. Then a real-world problem came to mind and I thought I could put the two together.</p><p>The real-world problem was reading shunts with non-decade meter measurements. For example, reading a shunt that&#039;s 100 amps and 100mV full-scale is no issue... I just move the decimal point in my head and I can easily read what the actual amps are. But, I have shunts like 200A at 75mV full-scale and 5A at 75mV. Now the readings in mV requires a calculator to get the real amps. Since I do calibrations on large power supplies (like an Elgar TW5250-3, an AMREL SPSX, etc.) that can require ~500 calibration setpoints, and multiple attempts for each one to zero-in on&nbsp; the correct values, going to the calculator for every current reading was costing days of labor time. Since this issue is just a matter of math, why not let an Arduino handle the math... simple enough. Stuff the meter data into an Arduino, do some math and display it on an LCD... done! But, I could not leave well enough alone. Enter my tablet for a graphical interface and RemoteXY.</p><p>I first attempted to use BlueTooth Electronics from Keuwl because it was free and I really liked the graphic options. After spending a month on the project, I became troubled with Keuwl&#039;s program for one reason... the data was intermittently corrupted and therefor would crash the graphic interface. Moreover was the meter data would also be corrupted. I tried everything to fix the issue, but ultimately lost hope in ever getting something I could use professionally. Then I found RemoteXY. Disappointed (at first) in having to start over again and not having some of the features I had grown to like, I tried RemoteXY to see if it was stable and free from data corruptions. It turns out it&#039;s stable! All along, I was thinking I had hardware/software issues on my end that were causing the data corruption. Turns out it was Kewul&#039;s BlueTooth Electronics, not me. Relieved that the data could now be used without question, I started on this journey with RemoteXY.</p><p>I&#039;m still in the process of sorting everything out, but I have to say, I really do like RemoteXY, even if I don&#039;t fully understand everything it offers. I&#039;m willing to learn and it&#039;s paying off. I now have a project that saves my time and money in the office and it&#039;s a hit with the rest of the office. It spends more time on other peoples desks than it does mine. It makes me happy that it&#039;s liked so much. Oh, I guess I forgot to mention... I&#039;m an Engineering Technician repairing large industrial power supplies. Calibrations is only part of what I do. This RemoteXY and Arduino programming are a hobby for me, not my profession. </p><p>Thank you for letting me share this project,</p><p>Gary<br />--</p>]]></summary>
			<author>
				<name><![CDATA[ytvytv1]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=3265</uri>
			</author>
			<updated>2026-02-07T15:35:53Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=2117&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Meteo Station based on ESP 32]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1982&amp;action=new" />
			<summary type="html"><![CDATA[<p>For those who are interrsted on, I share an other of my app with RemoteXY </p><p><a target="_blank" href="https://remotexy.com/en/editor/5dee83add63bf345d548b3090f28c905/">https://remotexy.com/en/editor/5dee83ad … 90f28c905/</a></p><p>If you want some more informations, let me a message :=)</p>]]></summary>
			<author>
				<name><![CDATA[serge2804]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=365</uri>
			</author>
			<updated>2025-06-06T15:42:45Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1982&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[A Panel for control a "little train" circuit]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1949&amp;action=new" />
			<summary type="html"><![CDATA[<p>Hi every body,<br />I&#039;m happy to share with you my last project, even started months ago. <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p><a target="_blank" href="https://remotexy.com/en/editor/b7ab9f580e8432b46abca197ea355cb2/">https://remotexy.com/en/editor/b7ab9f58 … 7ea355cb2/</a></p><p>The interface is linked to an ESP32 on bluetooth. <br />the global project working, with the ESP and 2 arduino Mega exchanging many informations to each other</p>]]></summary>
			<author>
				<name><![CDATA[serge2804]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=365</uri>
			</author>
			<updated>2025-03-21T07:55:50Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1949&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Лабораторный эксперимент2-трубка Кундта]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1935&amp;action=new" />
			<summary type="html"><![CDATA[<p>Прошло почти два года как был опубликован материал по учебному эксперименту. Судя по отзывам тема обучения не актуальна на этом форуме. Тем не менее я попытаюсь еще раз обратиться к этой теме, так как результат первого эксперимента был положительный и&nbsp; хотелось бы его продолжить. Дело в том, что вывод графиков на экран оказался не так прост, как ожидалось, так как он конкурирует с прерываниями самой программы. ПОэтому пришлось решать эту проблему. Ее решение показано в следующем тексте<br /></p><div class="codebox"><pre><code>/*
   -- doublems --
   Два графика масштабированы
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.8 or later version 
   download by link [url]http://remotexy.com/en/library/[/url]
   To connect using RemoteXY mobile app by link [url]http://remotexy.com/en/download/[/url]                   
     - for ANDROID 4.11.1 or later version;
     - for iOS 1.9.1 or later version;
    
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.    
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// определение режима соединения и подключение библиотеки RemoteXY 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// настройки соединения 
#define REMOTEXY_WIFI_SSID &quot;doublems&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 6377
const byte dynPin=2;
//генерация звука на втором пине
const int IN_PIN = A0;
//прием звука на аналоговом пине а0
const int MAX_ADC_VALUE = 1023;//возможно изменить на 255
int frec;

// конфигурация интерфейса  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 43 bytes
  { 255,1,0,8,0,36,0,16,31,1,68,17,1,1,60,49,8,36,68,17,
  2,52,59,40,8,36,2,0,21,93,22,6,2,26,31,31,79,78,0,79,
  70,70,0 };

  
// структура определяет все переменные и события вашего интерфейса управления 
struct {

    // input variables
  uint8_t switch_1; // =1 если переключатель включен и =0 если отключен 

    // output variables
  float onlineGraph_1;
  float onlineGraph_2;

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



void setup() 
{
 RemoteXY_Init (); 
  pinMode(dynPin,OUTPUT);
  pinMode(IN_PIN, INPUT);
frec=3000;//исходное значение частоты 3000 Гц
 }

void loop() 
{ RemoteXY_Handler ();
   
   if ((RemoteXY.switch_1!=0)and(frec&lt;5000)){
      //инициализируем переменные
int mn = 1024;
int mx = 0;
tone(dynPin,frec);//запускаем генератор звука
for (int i=0; i &lt; 1000; ++i) {
    
  //ищем макс и мин значения амплитуды
int val = analogRead(IN_PIN);
mn = min(mn, val);
mx = max(mx, val);
}
//нашли размах амплитуды
       noTone(dynPin);//отключаем звук
    delayRXY(250);  
    RemoteXY.onlineGraph_1 = float (frec);
    RemoteXY.onlineGraph_2 = float (5.0 / MAX_ADC_VALUE* (mx - mn));
     frec=frec+10;//увеличиваем частоту на 100 для следующего измерения
 }
 else {if (RemoteXY.connect_flag==0) //если соединение смартфона и контроллера разорвалось, то

   {RemoteXY.switch_1=0; //устанавливаем выключатель в положение OFF.

   } //в этом случае при повторном соединении эффекты не запустятся самопроизвольно
    
  }
  }
  void delayRXY (uint32_t ms) {
  uint32_t t = millis ();
  while (millis () - t &lt; ms) RemoteXY_Handler ();
    
}</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[gorchakov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2370</uri>
			</author>
			<updated>2025-02-21T13:18:23Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1935&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[NodeMCU to manage garage door and lights, WiFi and Cloud versions]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1748&amp;action=new" />
			<summary type="html"><![CDATA[<p>This RemoteXY is fantastic, really!<br />In a couple of hours (I&#039;m a newbye in this platform) I made an app to control my garage door and lights, and it works too...</p><p>This project makes use of a Lolin NodeMCU v3.<br />I made two versions, WiFi and my own cloud on NAS.</p><p>Components:<br />- Push Switch, 2 colors, &quot;Open it&quot; and &quot;Close it&quot;, of course to open/close the door<br />- Push Switch, 2 colors, &quot;Lights&quot;, when door is open the app lets you switch on/off the lights (TO DO add photoresistor to automate switching)</p><p>If someone is interested to, download a ZIP containing both versions at: <br /><a target="_blank" href="https://mega.nz/file/ShUB2YQJ#AS3pI-ptR-8ZPkQ0EAixXP3OzP9MkHytajQQbVMenms">https://mega.nz/file/ShUB2YQJ#AS3pI-ptR … jQQbVMenms</a></p><p>Image:<br /><a target="_blank" href="https://mega.nz/file/W1VlzQyJ#z6hEzeAW69PpF6tVxBfz_K89MrH9zpBFzrbXJcLV7wM">https://mega.nz/file/W1VlzQyJ#z6hEzeAW6 … rbXJcLV7wM</a></p>]]></summary>
			<author>
				<name><![CDATA[francescangeli.francesco]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2659</uri>
			</author>
			<updated>2024-02-02T09:57:29Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1748&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[лабораторный эксперимент-опыт Кундта]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1642&amp;action=new" />
			<summary type="html"><![CDATA[<p>Трубка Кундта на основе микроконтроллера WeMos D1</p><p>Для проведения опыта Кундта со стоячими волнами в трубе можно воспользоваться возможностями современных микроконтроллеров. Для создания установки понадобятся трубка стеклянная или пластиковая диаметром от 12 мм и больше и длиной 50 см, микроконтроллер с WiFi-&nbsp; nodemcu или&nbsp; WeMos, зуммер KY-006&nbsp; и микрофонный модуль KY-037. Зуммер и микрофонный модуль помещаются на края трубки и подключаются к микроконтроллеру по схеме</p><p>Рисунок 1. Схема установки Кундта с изменением частоты звука<br />Программа создается в оболочке RemoteXY в следующем виде</p><p>Рисунок 2. Интерфейс управления установкой<br />После этого мы получаем заготовку кода и добавляем в нее свой код в соответствии с текстом<br />#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT<br />#include &lt;ESP8266WiFi.h&gt;</p><p>#include &lt;RemoteXY.h&gt;</p><p>// настройки соединения <br />#define REMOTEXY_WIFI_SSID &quot;doublems&quot;<br />#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;<br />#define REMOTEXY_SERVER_PORT 6377<br />const byte dynPin=2;<br />//генерация звука на втором пине<br />const int IN_PIN = A0;<br />//прием звука на аналоговом пине а0<br />const int MAX_ADC_VALUE = 1023;//возможно изменить на 255<br />int frec;</p><p>// конфигурация интерфейса&nbsp; <br />#pragma pack(push, 1)<br />uint8_t RemoteXY_CONF[] =&nbsp; &nbsp;// 43 bytes<br />&nbsp; { 255,1,0,8,0,36,0,16,31,1,68,17,1,1,60,49,8,36,68,17,<br />&nbsp; 2,52,59,40,8,36,2,0,21,93,22,6,2,26,31,31,79,78,0,79,<br />&nbsp; 70,70,0 };</p><p>&nbsp; <br />// структура определяет все переменные и события вашего интерфейса управления <br />struct {</p><p>&nbsp; &nbsp; // input variables<br />&nbsp; uint8_t switch_1; // =1 если переключатель включен и =0 если отключен </p><p>&nbsp; &nbsp; // output variables<br />&nbsp; float onlineGraph_1;<br />&nbsp; float onlineGraph_2;</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><br /><br /><p>void setup() <br />{<br /> RemoteXY_Init (); <br />&nbsp; pinMode(dynPin,OUTPUT);<br />&nbsp; pinMode(IN_PIN, INPUT);<br />frec=3000;//исходное значение частоты 3000 Гц<br /> }</p><p>void loop() <br />{ RemoteXY_Handler ();<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;if ((RemoteXY.switch_1!=0)and(frec&lt;5000)){<br />&nbsp; &nbsp; &nbsp; //инициализируем переменные<br />int mn = 1024;<br />int mx = 0;<br />tone(dynPin,frec);//запускаем генератор звука<br />for (int i=0; i &lt; 1000; ++i) {<br />&nbsp; &nbsp; <br />&nbsp; //ищем макс и мин значения амплитуды<br />int val = analogRead(IN_PIN);<br />mn = min(mn, val);<br />mx = max(mx, val);<br />}<br />//нашли размах амплитуды<br />&nbsp; &nbsp; &nbsp; &nbsp;noTone(dynPin);//отключаем звук<br />&nbsp; &nbsp; delayRXY(250);&nbsp; <br />&nbsp; &nbsp; RemoteXY.onlineGraph_1 = float (frec);<br />&nbsp; &nbsp; RemoteXY.onlineGraph_2 = float (5.0 / MAX_ADC_VALUE* (mx - mn));<br />&nbsp; &nbsp; &nbsp;frec=frec+10;//увеличиваем частоту на 100 для следующего измерения<br /> }<br /> else {if (RemoteXY.connect_flag==0) //если соединение смартфона и контроллера разорвалось, то</p><p>&nbsp; &nbsp;{RemoteXY.switch_1=0; //устанавливаем выключатель в положение OFF.</p><p>&nbsp; &nbsp;} //в этом случае при повторном соединении эффекты не запустятся самопроизвольно<br />&nbsp; &nbsp; <br />&nbsp; }<br />&nbsp; }<br />&nbsp; void delayRXY (uint32_t ms) {<br />&nbsp; uint32_t t = millis ();<br />&nbsp; while (millis () - t &lt; ms) RemoteXY_Handler ();<br />&nbsp; &nbsp; <br />}<br />Общая идея программы состоит в следующем: по включении тумблера микроконтроллер начинает генерировать звуковую волну заданной частотой и в течении 1000 циклов ищет максимальное и минимальное значение амплитуды сигнала, после чего выдает на график значение частоты и амплитуды. Затем увеличивает значение частоты и повторяет то же самое до тех пор, пока не достигнет граничного значения, строя таким образом одновременно два графика-зависимости частоты и амплитуды от времени. </p><p>Из этих графиков можно определить зависимость амплитуды от частоты. Выполнение работы может быть произведено как локально, так и удаленно через облачный сервер. Создавая интерфейс, я старался сделать графики максимально большими и сначала растянул их так, что они заняли всю площадь экрана. Оказалось, что так нельзя, так как должны быть небольшие промежутки между графиками, иначе не строит. Из этих графиков в принципе можно вытащить частоты максимумов и вычислить скорость звука.<br />Жаль не умею графики вставлять.</p>]]></summary>
			<author>
				<name><![CDATA[gorchakov]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2370</uri>
			</author>
			<updated>2023-04-04T03:28:46Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1642&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[LED Indicator]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1631&amp;action=new" />
			<summary type="html"><![CDATA[<p>Can someone help me set up a indicator light on Remotexy please?</p><p>I would like a LED to light on on the display if a Digital Input is active.<br />I can&#039;t seem to figure out how to program that. I am using a Arduino mega.</p><p>Thx.</p>]]></summary>
			<author>
				<name><![CDATA[kasari62]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2387</uri>
			</author>
			<updated>2023-03-21T18:50:38Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1631&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[scheduled on/off time]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1538&amp;action=new" />
			<summary type="html"><![CDATA[<p>Hello every one<br />please help me to set up a scheduled on/off timer<br />thanks in advance</p>]]></summary>
			<author>
				<name><![CDATA[masoudzpqm.1957]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1584</uri>
			</author>
			<updated>2022-08-30T17:22:18Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1538&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Cannot find RemoteXY on mobile app]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1452&amp;action=new" />
			<summary type="html"><![CDATA[<p>After setting up sketch on PC and opening RemeteXY mobile App, selecting &quot;+&quot;, I select Bluetooth or Wifi point but do not find RemoteXY. I only see my home Wifi point. What did I miss?</p>]]></summary>
			<author>
				<name><![CDATA[ldmdewet]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2045</uri>
			</author>
			<updated>2022-01-18T11:12:14Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1452&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[changing the icon]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1438&amp;action=new" />
			<summary type="html"><![CDATA[<p>hi</p><p>Is it possible to change the icon image of RemoteXY on mobile?<br />This is for production.<br />If there is cost, pls kindly advise</p><p>Thanks</p>]]></summary>
			<author>
				<name><![CDATA[totempole]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2030</uri>
			</author>
			<updated>2022-01-02T07:53:08Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1438&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Wifi-controlled Hovercraft and Zeppelin (blimp)]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1389&amp;action=new" />
			<summary type="html"><![CDATA[<p>At the Maker faire Eindhoven this weekend, there will be workshops creating hovercrafts &amp; also a demo of flying a blimp (zeppelin)</p>]]></summary>
			<author>
				<name><![CDATA[FedericoBusero]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=466</uri>
			</author>
			<updated>2021-09-21T18:50:23Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1389&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Using RemoteXY on Node-Red to control RPi (or anything with MQTT)]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1340&amp;action=new" />
			<summary type="html"><![CDATA[<p>I have just started using Node-Red, and of course that means I want to integrate all the things <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>I had thought of ways of using an ESP and custom code to somehow interface between RemoteXY and MQTT... but in the process I came across this older Node-Red contrib</p><p><a target="_blank" href="https://github.com/DeanCording/node-red-contrib-remote-xy">https://github.com/DeanCording/node-red … -remote-xy</a></p><p>And used it to make a simple test, reading a timestamp from Node-Red and toggling an LED on the RPi</p><p><span class="postimg"><img src="https://www.dropbox.com/s/hdr3bb4r0831fjd/RXY%20-%20RPi%20and%20Node-Red.png?dl=1" alt="https://www.dropbox.com/s/hdr3bb4r0831fjd/RXY%20-%20RPi%20and%20Node-Red.png?dl=1" /></span></p><p>And here is the Flow JSON for any NR users...<br /></p><div class="codebox"><pre><code>[{&quot;id&quot;:&quot;78ffec39.ca2794&quot;,&quot;type&quot;:&quot;tab&quot;,&quot;label&quot;:&quot;RemoteXY&quot;,&quot;disabled&quot;:false,&quot;info&quot;:&quot;&quot;},{&quot;id&quot;:&quot;7084caed.f69234&quot;,&quot;type&quot;:&quot;remote-xy in&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;switch_1&quot;,&quot;dashboard&quot;:&quot;e02397d0.856d38&quot;,&quot;index&quot;:&quot;0&quot;,&quot;x&quot;:120,&quot;y&quot;:120,&quot;wires&quot;:[[&quot;4128ffc6.27135&quot;]]},{&quot;id&quot;:&quot;4d16de8b.8ee21&quot;,&quot;type&quot;:&quot;remote-xy out&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;text_1&quot;,&quot;dashboard&quot;:&quot;e02397d0.856d38&quot;,&quot;index&quot;:&quot;0&quot;,&quot;x&quot;:490,&quot;y&quot;:200,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;47bca140.c4c36&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;&quot;,&quot;props&quot;:[{&quot;p&quot;:&quot;payload&quot;},{&quot;p&quot;:&quot;topic&quot;,&quot;vt&quot;:&quot;str&quot;}],&quot;repeat&quot;:&quot;1&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:true,&quot;onceDelay&quot;:0.1,&quot;topic&quot;:&quot;&quot;,&quot;payload&quot;:&quot;&quot;,&quot;payloadType&quot;:&quot;date&quot;,&quot;x&quot;:140,&quot;y&quot;:200,&quot;wires&quot;:[[&quot;2072c169.731fde&quot;]]},{&quot;id&quot;:&quot;4128ffc6.27135&quot;,&quot;type&quot;:&quot;rpi-gpio out&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;&quot;,&quot;pin&quot;:&quot;12&quot;,&quot;set&quot;:true,&quot;level&quot;:&quot;0&quot;,&quot;freq&quot;:&quot;&quot;,&quot;out&quot;:&quot;out&quot;,&quot;x&quot;:300,&quot;y&quot;:120,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;2072c169.731fde&quot;,&quot;type&quot;:&quot;function&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;To Time &amp; Date&quot;,&quot;func&quot;:&quot;var now = new Date().toLocaleString(\&quot;en-US\&quot;);\nnow = now.replace(&#039;M&#039;,&#039;MM&#039;)\nreturn {payload: now};&quot;,&quot;outputs&quot;:1,&quot;noerr&quot;:0,&quot;initialize&quot;:&quot;&quot;,&quot;finalize&quot;:&quot;&quot;,&quot;libs&quot;:[],&quot;x&quot;:320,&quot;y&quot;:200,&quot;wires&quot;:[[&quot;4d16de8b.8ee21&quot;,&quot;1863d0f1.c9b0af&quot;]]},{&quot;id&quot;:&quot;1863d0f1.c9b0af&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;false&quot;,&quot;statusVal&quot;:&quot;&quot;,&quot;statusType&quot;:&quot;auto&quot;,&quot;x&quot;:520,&quot;y&quot;:260,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;e02397d0.856d38&quot;,&quot;type&quot;:&quot;remote-xy-dashboard&quot;,&quot;z&quot;:&quot;78ffec39.ca2794&quot;,&quot;name&quot;:&quot;RXY Test&quot;,&quot;port&quot;:&quot;6377&quot;,&quot;config&quot;:&quot;//////////////////////////////////////////////\n//        RemoteXY include library          //\n//////////////////////////////////////////////\n\n// RemoteXY select connection mode and include library \n#define REMOTEXY_MODE__ESP8266WIFI_LIB\n#include &lt;ESP8266WiFi.h&gt;\n\n#include &lt;RemoteXY.h&gt;\n\n// RemoteXY connection settings \n#define REMOTEXY_WIFI_SSID \&quot;YOUR_SSID\&quot;\n#define REMOTEXY_WIFI_PASSWORD \&quot;YOUR_PASS\&quot;\n#define REMOTEXY_SERVER_PORT 6377\n\n\n// RemoteXY configurate  \n#pragma pack(push, 1)\nuint8_t RemoteXY_CONF[] =\n  { 255,1,0,26,0,69,0,11,13,0,\n  67,5,23,18,52,5,2,26,26,2,\n  0,39,34,22,11,2,26,31,31,79,\n  78,0,79,70,70,0,129,0,32,11,\n  35,6,8,68,97,116,101,32,38,32,\n  84,105,109,101,0,129,0,28,27,45,\n  6,8,76,69,68,32,111,110,32,71,\n  80,73,79,49,56,0 };\n  \n// this structure defines all the variables and events of your control interface \nstruct {\n\n    // input variables\n  uint8_t switch_1; // =1 if switch ON and =0 if OFF \n\n    // output variables\n  char text_1[26];  // string UTF8 end zero \n\n    // other variable\n  uint8_t connect_flag;  // =1 if wire connected, else =0 \n\n} RemoteXY;\n#pragma pack(pop)\n\n/////////////////////////////////////////////\n//           END RemoteXY include          //\n/////////////////////////////////////////////\n&quot;}]</code></pre></div><br /><p>It works quite well so far... I will explore this more, as I like the idea of controlling an RPi via RemoteXY</p>]]></summary>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-06-26T19:04:18Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1340&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Old RC 4WD "Rock Crawler"]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1336&amp;action=new" />
			<summary type="html"><![CDATA[<p>Another &quot;dirt&quot; simple project that I now control with simplicity over WiFi AP and RemoteXY</p><p>It was an old RC car that didn&#039;t work anymore.&nbsp; I had gutted out the electronics and added my own.&nbsp; I also converted the steering from a motor to a servo.</p><p><span class="postimg"><img src="https://www.dropbox.com/s/bh9a35xxeyyq2wr/Rock%20Crawler%201.jpg?dl=1" alt="https://www.dropbox.com/s/bh9a35xxeyyq2wr/Rock%20Crawler%201.jpg?dl=1" /></span></p><p>- Arduino UNO<br />- Motor Shield (V1) - Drives two motors (front and back) in parallel for better current supply, each motor run off 1 of the 4 channels on the shield.<br />- ESP-01 transceiver (via Soft Serial over analog pins used as digital, as there was no other pins left on the shield)<br />- 2x 18650 LiPo cells for powering Arduino ESP and motors with 7.4vdc&nbsp; I use a 3.3v regulator to step down for the ESP</p><p>I had to search for an alternative servo library that didn&#039;t interfere with the one used by RemoteXY.&nbsp; Link in sketch.</p><p>Nothing fancy, but still fun to drive around.</p><div class="codebox"><pre><code>/*
   -- Rock Crawler --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.6 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
     - for ANDROID 4.7.12 or later version;
     - for iOS 1.4.7 or later version;

   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_SOFTSERIAL_POINT
#include &lt;SoftwareSerial.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX A0
#define REMOTEXY_SERIAL_TX A1
#define REMOTEXY_SERIAL_SPEED 9600
#define REMOTEXY_WIFI_SSID &quot;Rock Crawler&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255, 2, 0, 0, 0, 19, 0, 11, 27, 0,
  4, 48, 8, 1, 20, 61, 35, 26, 4, 176,
  40, 21, 59, 20, 14, 26
};

// this structure defines all the variables and events of your control interface
struct {

  // input variables
  int8_t speed_slider; // =-100..100 slider position
  int8_t direction_slider; // =-100..100 slider position

  // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



#include &lt;AFMotor.h&gt;  // https://lastminuteengineers.com/l293d-motor-driver-shield-arduino-tutorial/
// Both front and back motors controlled simultaneously on separate channels for for better power
AF_DCMotor motor_a(1);
AF_DCMotor motor_b(2);

#include &lt;Servo2.h&gt;  // Custom mod to prevent conflict with SoftwareSerial.h - https://forum.arduino.cc/t/softwareserial-and-servo-conflict/321859/6
Servo direction_servo;
#define servoPin 10



void setup() {
  RemoteXY_Init ();
  direction_servo.attach(servoPin);
  RemoteXY.speed_slider = 0;
}



void loop() {
  RemoteXY_Handler ();

  // Connection Failsafe
  if (RemoteXY_isConnected() == 0) {
    motor_a.run(RELEASE);
    motor_b.run(RELEASE);
  }
// Speed control (variable)
  if (RemoteXY.speed_slider &lt; -30) {  // Backward
    motor_a.run(BACKWARD);
    motor_b.run(BACKWARD);
    int set_speed = map(RemoteXY.speed_slider, -100, -21, 255, 0);
    motor_a.setSpeed(set_speed);
    motor_b.setSpeed(set_speed);
    //Serial.print(&quot;Backward &quot;); Serial.println(set_speed);
  } else if (RemoteXY.speed_slider &gt; 30) {  // Forward
    motor_a.run(FORWARD);
    motor_b.run(FORWARD);
    int set_speed = map(RemoteXY.speed_slider, 21, 100, 0, 255);
    motor_a.setSpeed(set_speed);
    motor_b.setSpeed(set_speed);
    //Serial.print(&quot;Forward &quot;); Serial.println(set_speed);
  } else {  // Stop
    motor_a.run(RELEASE);
    motor_b.run(RELEASE);
    //Serial.println(&quot;STOP&quot;);
  }

// Direction control - hard left, right or center... one could also make variable if the vehicle accommodates such flexibility.
  if (RemoteXY.direction_slider &lt; -30) {  // Left
    direction_servo.write(180);
    delay(15);
  } else if (RemoteXY.direction_slider &gt; 70) {  // Right
    direction_servo.write(0);
    delay(15);
  } else { // If centered
    direction_servo.write(90);
    delay(15);
  }
}</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-06-14T01:41:36Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1336&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Simple DHT Display for my desk using ESP-01 and and old tablet.]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1328&amp;action=new" />
			<summary type="html"><![CDATA[<p>As the title says, this is just a simple DHT based Temperature and Humidity desktop display that I made for my desk.</p><p>To keep the hardware simple, I used an ESP-01 connected to a DHT11 (I didn&#039;t have any spare DHT12) and an old Samsung 8&quot; Tablet that is much too slow for anything else.</p><p>The idea I had was for Arc Level gauges that dynamically change colour based on their ranges, via the RGB features of the LED as a background.&nbsp; But lack of Element background transparency became an issue.&nbsp; So this is what I currently have...</p><p><span class="postimg"><img src="https://www.dropbox.com/s/swkbtjk6jpd7ck8/ESP-01%20%20and%20DHT11.png?dl=1" alt="https://www.dropbox.com/s/swkbtjk6jpd7ck8/ESP-01%20%20and%20DHT11.png?dl=1" /></span></p><p>At the moment the LED colours are an extremely simple range between green and red for temperature and green and blue for Humidity.&nbsp; But I may work on a better colour range algorithm in time.</p><p>Enjoy.</p><div class="codebox"><pre><code>/*
   -- Temperature and Humidity --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
     - for ANDROID 4.7.12 or later version;
     - for iOS 1.4.7 or later version;

   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include &lt;ESP8266WiFi.h&gt;

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings
#define REMOTEXY_WIFI_SSID &quot;ESP-01_Temp_Humid&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;12345678&quot;
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,0,0,38,0,128,0,11,24,0,
  130,1,18,3,26,24,25,130,1,1,
  29,98,32,25,68,18,3,31,94,28,
  26,1,190,65,31,20,5,22,20,66,
  132,19,4,24,19,26,16,130,0,27,
  12,8,8,26,67,1,26,13,10,6,
  1,24,11,129,0,20,23,22,3,16,
  84,69,77,80,69,82,65,84,85,82,
  69,0,130,1,56,3,26,24,25,65,
  31,58,5,22,20,66,132,57,4,24,
  19,26,16,130,0,65,12,8,8,26,
  67,1,63,13,12,6,190,27,11,129,
  0,62,23,14,3,16,72,85,77,73,
  68,73,84,89,0 };

// this structure defines all the variables and events of your control interface
struct {

  // output variables
  float temp_graph;
  float hum_graph;
  uint8_t temp_led_r; // =0..255 LED Red brightness
  uint8_t temp_led_g; // =0..255 LED Green brightness
  uint8_t temp_led_b; // =0..255 LED Blue brightness
  int8_t temp_level; // =0..100 level position
  char temp_txt[11];  // string UTF8 end zero
  uint8_t hum_led_r; // =0..255 LED Red brightness
  uint8_t hum_led_g; // =0..255 LED Green brightness
  uint8_t hum_led_b; // =0..255 LED Blue brightness
  int8_t hum_level; // =0..100 level position
  char hum_txt[11];  // string UTF8 end zero

  // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#include &lt;Adafruit_Sensor.h&gt;
#include &lt;DHT.h&gt;

#define DHTPIN 0     // Digital pin connected to the DHT sensor

// Uncomment the type of sensor in use:
#define DHTTYPE    DHT11     // DHT 11
//#define DHTTYPE    DHT22     // DHT 22 (AM2302)
//#define DHTTYPE    DHT21     // DHT 21 (AM2301)

DHT dht(DHTPIN, DHTTYPE);

// current temperature &amp; humidity, updated in loop()
float t = 0.0;
float h = 0.0;

// Generally, you should use &quot;unsigned long&quot; for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0;    // will store last time DHT was updated

// Updates DHT readings every 10 seconds
const long interval = 10000;



void setup() {
  RemoteXY_Init ();
  dht.begin();
}



void loop() {
  RemoteXY_Handler ();

  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis &gt;= interval) {
    // save the last time you updated the DHT values
    previousMillis = currentMillis;
    // Read temperature as Celsius (the default)
    float temperature = dht.readTemperature();
    // Read temperature as Fahrenheit (isFahrenheit = true)

    // if temperature read failed, don&#039;t change t value
    if (isnan(temperature)) {
      delay(10);
    }
    else {
      RemoteXY.temp_graph = temperature;
      RemoteXY.temp_level = temperature;
      dtostrf(temperature, 0, 0, RemoteXY.temp_txt);
      RemoteXY.temp_led_r = map(temperature,0,40,0,255);
      RemoteXY.temp_led_g = map(temperature,0,40,255,0);
    }
    // Read Humidity
    float humidity = dht.readHumidity();
    // if humidity read failed, don&#039;t change h value
    if (isnan(humidity)) {
      delay(10);
    }
    else {
      RemoteXY.hum_graph = humidity;
      RemoteXY.hum_level = humidity;
      dtostrf(humidity, 0, 0, RemoteXY.hum_txt);
      RemoteXY.hum_led_b = map(humidity,0,100,0,255);
      RemoteXY.hum_led_g = map(humidity,0,100,255,0);
    }
  }
}</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-06-02T06:06:01Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1328&amp;action=new</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Dual Webpage and App controlled RGB LED]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?id=1325&amp;action=new" />
			<summary type="html"><![CDATA[<p>Sometimes (OK, lots of times) I do silly and mostly meaningless things just to see if I can.&nbsp; This is one of those times.</p><p>After playing around with a Webserver/client sketch for ESP32, I figured I would try to see if I could integrate RemoteXY into the sketch as well.&nbsp; </p><p>As the Webserver was using the WiFi, I setup RemoteXY with BLE... I wasn&#039;t sure if both would work at the same time or not... yes, I could have Googled that, but just jumping in was more fun.&nbsp; </p><p>Short answer... yes, but you may need to connect the App very shortly after restarting the ESP32, else it sometimes seems to have problems grabbing the GUI info.&nbsp; This is most likely due to the shared radio between WiFi and BT... At bootup, and because it starts first in the code, the BLE has time to send the GUI prior to the WiFi taking over.&nbsp; And since after the GUI, the BLE commands are short and sweet, they get through in between WiFi timing.</p><p>In this forum, I am only including my Arduino sketch... you will need to go to this (unaffiliated with me) site to figure out the rest of the needed files for the SPIFFS, if you so chose such silliness as duplicating this project <img src="https://forum.remotexy.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" />&nbsp; <a target="_blank" href="https://randomnerdtutorials.com/esp32-web-server-websocket-sliders">https://randomnerdtutorials.com/esp32-w … et-sliders</a></p><p>Meanwhile, what I did (and was what much of the challenge for me) was figure out how to write code that mixed and merged the incoming and outgoing processes so changes made on a web client or on the RemoteXY App, simultaneously updated each other, and of course both the physical LED and virtual one match colours, as shown here...</p><p><span class="postimg"><img src="https://www.dropbox.com/s/2jhsrlosdpoubmn/App%20and%20Web%20controlled%20RGB%20sliders.jpg?dl=1" alt="https://www.dropbox.com/s/2jhsrlosdpoubmn/App%20and%20Web%20controlled%20RGB%20sliders.jpg?dl=1" /></span></p><p>FYI, for the curious, long ago I made myself that RGBW test rig from a common anode RGB LED, a white LED (you can&#039;t see those wires) a dead household LED bulb casing and an empty wire spool.&nbsp; Sometimes I just have too much time on my hands <img src="https://forum.remotexy.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Anyhow... Most of the input/output merger code is in the <strong>void loop()</strong> but a few lines that update the App sliders are in the rest of the code...and I commented those as needed.</p><p>Enjoy!</p><p><strong>PS.</strong>&nbsp; I found I needed to set the Partition Scheme to &quot;Minimal SPIFFS (Large APPS with OTA)&quot; with my particular MCU WEMOS LOLIN32 in order to get it to fit when flashing.</p><div class="codebox"><pre><code>/*
   -- LEDs and Sliders - BLE Merger with WebServer --

   This source code of graphical user interface
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.4.3 or later version
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
     - for ANDROID 4.7.12 or later version;
     - for iOS 1.4.7 or later version;

   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP32CORE_BLE

#include &lt;RemoteXY.h&gt;

// RemoteXY connection settings
#define REMOTEXY_BLUETOOTH_NAME &quot;RGB &amp; Web Server&quot;


// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255, 3, 0, 3, 0, 33, 0, 11, 13, 0,
  4, 128, 9, 43, 27, 9, 1, 26, 65, 23,
  36, 7, 27, 27, 4, 128, 37, 43, 26, 9,
  12, 26, 4, 128, 64, 43, 27, 9, 6, 26
};

// this structure defines all the variables and events of your control interface
struct {

  // input variables
  int8_t slider_red; // =0..100 slider position
  int8_t slider_green; // =0..100 slider position
  int8_t slider_blue; // =0..100 slider position

  // output variables
  uint8_t RGB_LED_r; // =0..255 LED Red brightness
  uint8_t RGB_LED_g; // =0..255 LED Green brightness
  uint8_t RGB_LED_b; // =0..255 LED Blue brightness

  // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////



/*
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/esp32-web-server-websocket-sliders/

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

#include &lt;Arduino.h&gt;
#include &lt;WiFi.h&gt;
#include &lt;AsyncTCP.h&gt;
#include &lt;ESPAsyncWebServer.h&gt;
#include &quot;SPIFFS.h&quot;
#include &lt;Arduino_JSON.h&gt;

// Replace with your network credentials
const char* ssid = &quot;YOUR_SSID&quot;;
const char* password = &quot;YOUR_PASSWORD&quot;;

// Create AsyncWebServer object on port 80
AsyncWebServer server(80);
// Create a WebSocket object

AsyncWebSocket ws(&quot;/ws&quot;);
// Set LED GPIO
const int ledPin1 = 25; // Red
const int ledPin2 = 27; // Green
const int ledPin3 = 26; // Blue

String message = &quot;&quot;;
String sliderValue1 = &quot;0&quot;;
String sliderValue2 = &quot;0&quot;;
String sliderValue3 = &quot;0&quot;;

int dutyCycle1;
int dutyCycle2;
int dutyCycle3;

// setting PWM properties
const int freq = 5000;
const int ledChannel1 = 0;
const int ledChannel2 = 1;
const int ledChannel3 = 2;

const int resolution = 8;

//Json Variable to Hold Slider Values
JSONVar sliderValues;

//Get Slider Values
String getSliderValues() {
  sliderValues[&quot;sliderValue1&quot;] = String(sliderValue1);
  sliderValues[&quot;sliderValue2&quot;] = String(sliderValue2);
  sliderValues[&quot;sliderValue3&quot;] = String(sliderValue3);

  String jsonString = JSON.stringify(sliderValues);
  return jsonString;
}

// Initialize SPIFFS
void initFS() {
  if (!SPIFFS.begin()) {
    Serial.println(&quot;An error has occurred while mounting SPIFFS&quot;);
  }
  else {
    Serial.println(&quot;SPIFFS mounted successfully&quot;);
  }
}

// Initialize WiFi
void initWiFi() {
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.print(&quot;Connecting to WiFi ..&quot;);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(&#039;.&#039;);
    delay(1000);
  }
  Serial.println(WiFi.localIP());
}

void notifyClients(String sliverValues) {
  ws.textAll(sliverValues);
}

void handleWebSocketMessage(void *arg, uint8_t *data, size_t len) {
  AwsFrameInfo *info = (AwsFrameInfo*)arg;
  if (info-&gt;final &amp;&amp; info-&gt;index == 0 &amp;&amp; info-&gt;len == len &amp;&amp; info-&gt;opcode == WS_TEXT) {
    data[len] = 0;
    message = (char*)data;
    if (message.indexOf(&quot;1s&quot;) &gt;= 0) {
      sliderValue1 = message.substring(2);
      dutyCycle1 = map(sliderValue1.toInt(), 0, 100, 0, 255);
      RemoteXY.slider_red = sliderValue1.toInt();  // RemoteXY command to update red slider
      //Serial.println(dutyCycle1);
      //Serial.print(getSliderValues());
      notifyClients(getSliderValues());
    }
    if (message.indexOf(&quot;2s&quot;) &gt;= 0) {
      sliderValue2 = message.substring(2);
      dutyCycle2 = map(sliderValue2.toInt(), 0, 100, 0, 255);
      RemoteXY.slider_green = sliderValue2.toInt();  // RemoteXY command to update green slider
      //Serial.println(dutyCycle2);
      //Serial.print(getSliderValues());
      notifyClients(getSliderValues());
    }
    if (message.indexOf(&quot;3s&quot;) &gt;= 0) {
      sliderValue3 = message.substring(2);
      dutyCycle3 = map(sliderValue3.toInt(), 0, 100, 0, 255);
      RemoteXY.slider_blue = sliderValue3.toInt();  // RemoteXY command to update blue slider
      //Serial.println(dutyCycle3);
      //Serial.print(getSliderValues());
      notifyClients(getSliderValues());
    }
    if (strcmp((char*)data, &quot;getValues&quot;) == 0) {
      notifyClients(getSliderValues());
    }
  }
}
void onEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventType type, void *arg, uint8_t *data, size_t len) {
  switch (type) {
    case WS_EVT_CONNECT:
      Serial.printf(&quot;WebSocket client #%u connected from %s\n&quot;, client-&gt;id(), client-&gt;remoteIP().toString().c_str());
      break;
    case WS_EVT_DISCONNECT:
      Serial.printf(&quot;WebSocket client #%u disconnected\n&quot;, client-&gt;id());
      break;
    case WS_EVT_DATA:
      handleWebSocketMessage(arg, data, len);
      break;
    case WS_EVT_PONG:
    case WS_EVT_ERROR:
      break;
  }
}

void initWebSocket() {
  ws.onEvent(onEvent);
  server.addHandler(&amp;ws);
}


void setup() {
  RemoteXY_Init (); // RemoteXT Command

  Serial.begin(115200);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  initFS();
  initWiFi();

  // configure LED PWM functionalitites
  ledcSetup(ledChannel1, freq, resolution);
  ledcSetup(ledChannel2, freq, resolution);
  ledcSetup(ledChannel3, freq, resolution);

  // attach the channel to the GPIO to be controlled
  ledcAttachPin(ledPin1, ledChannel1);
  ledcAttachPin(ledPin2, ledChannel2);
  ledcAttachPin(ledPin3, ledChannel3);


  initWebSocket();

  // Web Server Root URL
  server.on(&quot;/&quot;, HTTP_GET, [](AsyncWebServerRequest * request) {
    request-&gt;send(SPIFFS, &quot;/index.html&quot;, &quot;text/html&quot;);
  });

  server.serveStatic(&quot;/&quot;, SPIFFS, &quot;/&quot;);

  // Start server
  server.begin();

}

void loop() {
  RemoteXY_Handler(); // RemoteXY Command

  // Read RED slider value from RemoteXY, update web clients and physical LED to match
  int slideRed = sliderValue1.toInt();
  if (RemoteXY.slider_red != slideRed) {  // Check if RemoteXY slider has changed
    dutyCycle1 = map(RemoteXY.slider_red, 0, 100, 0, 255);  // Adjust Physical LED
    sliderValue1 = RemoteXY.slider_red;  // Adjust Web Client slider
    notifyClients(getSliderValues());  // Update Web Clients
  }

  // Read GREEN slider value from RemoteXY, update web clients and physical LED to match
  int slideGreen = sliderValue2.toInt();
  if (RemoteXY.slider_green != slideGreen) {  // Check if RemoteXY slider has changed
    dutyCycle2 = map(RemoteXY.slider_green, 0, 100, 0, 255);  // Adjust Physical LED
    sliderValue2 = RemoteXY.slider_green;  // Adjust Web Client slider
    notifyClients(getSliderValues());  // Update Web Clients
  }

  // Read BLUE slider value from RemoteXY, update web clients and physical LED to match
  int slideBlue = sliderValue3.toInt();
  if (RemoteXY.slider_blue != slideBlue) {  // Check if RemoteXY slider has changed
    dutyCycle3 = map(RemoteXY.slider_blue, 0, 100, 0, 255);  // Adjust Physical LED
    sliderValue3 = RemoteXY.slider_blue;  // Adjust Web Client slider
    notifyClients(getSliderValues());  // Update Web Clients
  }

  ledcWrite(ledChannel1, 255 - dutyCycle1); // -255 for Common Anode
  RemoteXY.RGB_LED_r = dutyCycle1; // RemoteXY command to update App Red LED

  ledcWrite(ledChannel2, 255 - dutyCycle2); // -255 for Common Anode
  RemoteXY.RGB_LED_g = dutyCycle2; // RemoteXY command to update App Green LED

  ledcWrite(ledChannel3, 255 - dutyCycle3); // -255 for Common Anode
  RemoteXY.RGB_LED_b = dutyCycle3; // RemoteXY command to update App Blue LED

  ws.cleanupClients();
}</code></pre></div>]]></summary>
			<author>
				<name><![CDATA[Gunner]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1840</uri>
			</author>
			<updated>2021-05-29T09:23:23Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?id=1325&amp;action=new</id>
		</entry>
</feed>
