<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ATOM Lite - broker status LED? (with two devices)]]></title><description><![CDATA[<p dir="auto">Hi all!</p>
<p dir="auto">I would really appreciate your help. I am new to M5Stack devices and tried to program an IR/WLAN gateway. When I programmed with my first device, I didn't realize that the status LED is not working any more. It worked at the beginning - I am sure. Then, with the same program I tried it on teh second device where the LED turned on with the first plug in of USB cable.<br />
Now, also the second device LED is probably brokern.</p>
<p dir="auto">I tried the simple demos blink.ino etc but could not get the LEDs running.</p>
<p dir="auto">My program looks as follows:</p>
<p dir="auto">#include &lt;M5Atom.h&gt;<br />
#include &lt;WiFi.h&gt;<br />
#include &lt;WiFiMulti.h&gt;</p>
<p dir="auto">// External library: IRRemoteESP8266, <a href="https://github.com/crankyoldgit/IRremoteESP8266" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/crankyoldgit/IRremoteESP8266</a><br />
#include &lt;IRrecv.h&gt;<br />
#include &lt;IRremoteESP8266.h&gt;</p>
<p dir="auto">// HW: Pin assignments<br />
const byte PIN_BUTTON = 39; // M5Stack Atom Lite: internal button<br />
const byte PIN_LEDATOM = 27; // M5Stack Atom Lite: internel Neopixel LED<br />
const byte PIN_LEDSTRIP = 26; // M5SAtack Atom Lite: Grove connector GPIO pin (yellow cable) -&gt; Neopixel LED strip<br />
const byte PIN_IRRECV = 32; // M5SAtack Atom Lite: Grove connector GPIO pin (white cable) -&gt; IR Receiver</p>
<p dir="auto">// Type declarations<br />
enum State {OFF = 0, ON = 1, ECO = 2}; // Main system states<br />
typedef enum State t_State;</p>
<p dir="auto">// Switch to receive debug messages via serial monitor<br />
const bool DEBUG_ON = false;</p>
<p dir="auto">// Status LED: color definitions<br />
const uint8_t COLOR_OFF[3] = {255, 0, 0}; // System state: OFF<br />
const uint8_t COLOR_ON[3]  = {0, 255, 0}; // System state: ON<br />
const uint8_t COLOR_ECO[3] = {0, 255, 0}; // System state: ECO</p>
<p dir="auto">// Status LED and LED strip: Brightness constants<br />
const uint8_t BRIGHTNESS_OFF = 8;  // System state: OFF<br />
const uint8_t BRIGHTNESS_ON  = 20; // System state: ON<br />
const uint8_t BRIGHTNESS_ECO = 10; // System state: ECO</p>
<p dir="auto">const uint8_t BRIGHTNESS_MIN  = 2;  // Lowest brightness<br />
const uint8_t BRIGHTNESS_MAX  = 50; // Highest brightness --&gt; maximum current<br />
const uint8_t BRIGHTNESS_STEP = 2;  // Increment for brightness adjustement via IR remote</p>
<p dir="auto">// Time constant, i.e. time after which light effects are updated<br />
const int TIME_CYCLE = 5; // ms</p>
<p dir="auto">// IR Commands (values depend on the remote control used)<br />
const uint64_t IR_CHminus = 0xFFA25D;<br />
const uint64_t IR_CH = 0xFF629D;<br />
const uint64_t IR_CHplus = 0xFFE21D;</p>
<p dir="auto">const uint64_t IR_PREV = 0xFF22DD;<br />
const uint64_t IR_NEXT = 0xFF02FD;<br />
const uint64_t IR_PLAY = 0xFFC23D;</p>
<p dir="auto">const uint64_t IR_MINUS = 0xFFE01F;<br />
const uint64_t IR_PLUS = 0xFFA857;<br />
const uint64_t IR_EQ = 0xFF906F;</p>
<p dir="auto">const uint64_t IR_ZERO = 0xFF6897;<br />
const uint64_t IR_HUNDRET = 0xFF9867;<br />
const uint64_t IR_TWOHUNDRET = 0xFFB04F;</p>
<p dir="auto">const uint64_t IR_ONE = 0xFF30CF;<br />
const uint64_t IR_TWO = 0xFF18E7;<br />
const uint64_t IR_THREE = 0xFF7A85;</p>
<p dir="auto">const uint64_t IR_FOUR = 0xFF10EF;<br />
const uint64_t IR_FIVE = 0xFF38C7;<br />
const uint64_t IR_SIX = 0xFF5AA5;</p>
<p dir="auto">const uint64_t IR_SEVEN = 0xFF42BD;<br />
const uint64_t IR_EIGHT = 0xFF4AB5;<br />
const uint64_t IR_NINE = 0xFF52AD;</p>
<p dir="auto">// IR receiver library parameters<br />
const uint16_t IR_BUFFER_SIZE = 1024;<br />
const uint8_t IR_MSG_TIMEOUT = 15;</p>
<p dir="auto">// ------------------------<br />
// Homematic stuff<br />
// ------------------------<br />
String ISE_ID = "24561"; //testvar</p>
<p dir="auto">String ip = "192.168.66.64";                             // Arduino IP-Adresse<br />
const char * HomematicIP  = "192.168.66.65";             // Homematic IP-Adresse<br />
const uint16_t HomematicPort = 80;                      //The port of the TCP server is specified.</p>
<p dir="auto">// -----------------------------------------------------------------------------<br />
// Object and variable definitions<br />
// -----------------------------------------------------------------------------</p>
<p dir="auto">//EthernetClient client;<br />
WiFiMulti WiFiMulti;<br />
WiFiClient client;<br />
bool connected;</p>
<p dir="auto">//IR receive<br />
IRrecv IrRecv(PIN_IRRECV, IR_BUFFER_SIZE, IR_MSG_TIMEOUT, true);</p>
<p dir="auto">// Buffer for decoded IR command<br />
decode_results irCmd;</p>
<p dir="auto">// IR command status<br />
bool irCmdAvailable = false; // True, if new IR code has been received and decoded</p>
<p dir="auto">// Last IR command received and decoded<br />
uint64_t irCmdValue = 0;</p>
<p dir="auto">// -----------------------------------------------------------------------------<br />
// Setup routine<br />
// -----------------------------------------------------------------------------</p>
<p dir="auto">void setup()<br />
{<br />
delay(1000);</p>
<p dir="auto">if (DEBUG_ON)<br />
{<br />
Serial.begin(115200);<br />
Serial.print("\nWaiting connect to WiFi...");<br />
}</p>
<p dir="auto">M5.begin(true, false, true); //Init Atom(Initialize serial port, LED).</p>
<p dir="auto">M5.dis.setBrightness(10); // tried to set this - also to 100. But was not there when I damaged the status LED.</p>
<p dir="auto">WiFiMulti.addAP("mywlan", "mypass");  //Add wifi configuration information.</p>
<p dir="auto">while (WiFiMulti.run() != WL_CONNECTED) { //If the connection to wifi is not established successfully.<br />
if (DEBUG_ON) Serial.print(".");<br />
delay(300);<br />
}</p>
<p dir="auto">if (DEBUG_ON)<br />
{<br />
Serial.println("\nWiFi connected");<br />
Serial.print("IP address: ");<br />
Serial.println(WiFi.localIP());<br />
}<br />
// initialize the button object<br />
M5.update();</p>
<p dir="auto">IrRecv.enableIRIn(); // Switch on IR receiver after initialization</p>
<p dir="auto">M5.dis.drawpix(0, 0x00ff00);  //GREEN<br />
}</p>
<p dir="auto">// -----------------------------------------------------------------------------<br />
// Main routine<br />
// -----------------------------------------------------------------------------</p>
<p dir="auto">void SendHttp(String IRVal)<br />
{<br />
M5.dis.drawpix(0, 0xfff000);<br />
if (client.connect(HomematicIP, HomematicPort)) {<br />
if (DEBUG_ON) Serial.println("connected");<br />
if (DEBUG_ON) Serial.println("Value: (dec)" + IRVal);</p>
<pre><code>client.println("GET /config/xmlapi/statechange.cgi?ise_id=24561&amp;new_value=" + IRVal + " HTTP/1.0");
client.println(); // end HTTP header

/*while (client.available()) {
  char c = client.read();
  if (DEBUG_ON) Serial.print(c);
  }
*/

client.stop();
</code></pre>
<p dir="auto">} else {<br />
if (DEBUG_ON) Serial.println("connection failed");<br />
M5.dis.drawpix(0, CRGB::Red);  //RED<br />
delay(1000);<br />
}<br />
M5.dis.drawpix(0, CRGB::Green);  //GREEN</p>
<p dir="auto">}</p>
<p dir="auto">void loop()<br />
{<br />
bool irCmdOnOff = false;</p>
<p dir="auto">// Determine the IR command state<br />
irCmdAvailable = IrRecv.decode(&amp;irCmd);</p>
<p dir="auto">if (irCmdAvailable)<br />
{<br />
M5.dis.drawpix(0, CRGB::Blue);  //BLUE<br />
if (irCmd.repeat) // Is it a repetition of the previous IR command?<br />
{<br />
irCmdAvailable = false;<br />
irCmdValue = 0x0;<br />
M5.dis.drawpix(0, CRGB::Green);  //GREEN<br />
}<br />
else {<br />
// No repetition: retrieve the IR command<br />
irCmdValue = irCmd.value;<br />
}</p>
<pre><code>IrRecv.resume();

if (irCmdAvailable)
{
  if (DEBUG_ON) Serial.print("IR: ");
  if (DEBUG_ON) Serial.println((unsigned long) irCmd.value, HEX);

  String IRValue = String((unsigned long)irCmd.value, HEX);
  SendHttp(IRValue);
}
</code></pre>
<p dir="auto">}</p>
<p dir="auto">// Process events "button released" or "IR on/off" respectively<br />
if (M5.Btn.wasPressed() )<br />
{<br />
M5.dis.drawpix(0, CRGB::White);  //GREEN<br />
if (DEBUG_ON) Serial.println("Button pressed");<br />
}</p>
<p dir="auto">delay(TIME_CYCLE); // Pause before next pass through loop<br />
}</p>
<p dir="auto">I use the Arduino IDE and tried to get the IR Unit running. The functionality is there, so my gateway is working. But when I order new ATOM LITEs I'd like to know which failure I did....</p>
<p dir="auto">Thanx<br />
Christian</p>
]]></description><link>https://community.m5stack.com/topic/3827/atom-lite-broker-status-led-with-two-devices</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 17:26:25 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3827.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 Dec 2021 00:32:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ATOM Lite - broker status LED? (with two devices) on Wed, 15 Dec 2021 22:31:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/14916">@ckohrt</a> - I also posted about this issue last week: <a href="https://community.m5stack.com/topic/3812/atom-lite-led">https://community.m5stack.com/topic/3812/atom-lite-led</a></p>
<p dir="auto">I had to downgrade the installed M5Stack-ATOM board to pre 2.0.0 to get it to work.</p>
]]></description><link>https://community.m5stack.com/post/15834</link><guid isPermaLink="true">https://community.m5stack.com/post/15834</guid><dc:creator><![CDATA[paulhdietz]]></dc:creator><pubDate>Wed, 15 Dec 2021 22:31:59 GMT</pubDate></item><item><title><![CDATA[Reply to ATOM Lite - broker status LED? (with two devices) on Wed, 15 Dec 2021 10:20:02 GMT]]></title><description><![CDATA[<p dir="auto">Ok, I copied the program and uploaded it, the LED stays dark. :(</p>
<p dir="auto">I am using the M5Stack-ATOM Board, I don't know if I have to use another one. But I couldn't find the "M5Stack-ATOM LITE". Do I need this?</p>
<p dir="auto">The M5Atom library is up to date version 0.0.7.</p>
<p dir="auto">It seems that there is an <a href="https://github.com/FastLED/FastLED/pull/1308" target="_blank" rel="noopener noreferrer nofollow ugc">issue</a> on git....</p>
<p dir="auto">I tried to downgrade to M5Atom Version 0.0.5 - didn't work. I also downgraded FastLED to 3.3.3 (from 3.4.0) with current M5Atom version 0.0.7- <strong>YES IT DID WORK!!!!!</strong></p>
<p dir="auto">Thank you VERY MUCH <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a>  for your hint which led me to the right direction!</p>
]]></description><link>https://community.m5stack.com/post/15829</link><guid isPermaLink="true">https://community.m5stack.com/post/15829</guid><dc:creator><![CDATA[ckohrt]]></dc:creator><pubDate>Wed, 15 Dec 2021 10:20:02 GMT</pubDate></item><item><title><![CDATA[Reply to ATOM Lite - broker status LED? (with two devices) on Wed, 15 Dec 2021 07:15:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/4037">@felmue</a> said in <a href="/post/15816">ATOM Lite - broker status LED? (with two devices)</a>:</p>
<blockquote>
<p dir="auto">delay(50);</p>
</blockquote>
<p dir="auto">Thanks, I'll try that...</p>
]]></description><link>https://community.m5stack.com/post/15825</link><guid isPermaLink="true">https://community.m5stack.com/post/15825</guid><dc:creator><![CDATA[ckohrt]]></dc:creator><pubDate>Wed, 15 Dec 2021 07:15:26 GMT</pubDate></item><item><title><![CDATA[Reply to ATOM Lite - broker status LED? (with two devices) on Tue, 14 Dec 2021 05:14:08 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/14916">@ckohrt</a></p>
<p dir="auto">the LED in your M5Atoms are most likely not broken. Try this <a href="https://github.com/m5stack/M5Atom/blob/master/examples/Basics/LEDSet/LEDSet.ino" target="_blank" rel="noopener noreferrer nofollow ugc">example</a>.</p>
<p dir="auto">From that example it looks like a <code>delay(50);</code> is required before the first call to <code>M5.dis.drawpix();</code> else the LED stays dark.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/15816</link><guid isPermaLink="true">https://community.m5stack.com/post/15816</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Tue, 14 Dec 2021 05:14:08 GMT</pubDate></item></channel></rss>