<?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[NodeManager on STM32F103C8 - RS485 Gateway + INA219 + OLED]]></title><description><![CDATA[<p dir="auto">Hi all,<br />
two monts ago I've created simple RS485 gateway (with NodeManager) based on STM32F103C8. It's working very stable (ok right now I'm using only two nodes :) - for test reason) and now I've created 2-nd version with INA219 and OLED SH1106.<br />
<img src="/assets/uploads/files/1561967044337-photo5821056587899449907.jpg" alt="2_1561967420588_photo5821056587899449907.jpg" class=" img-fluid img-markdown" /> <img src="/assets/uploads/files/1561967044003-photo5821056587899449906.jpg" alt="1_1561967420588_photo5821056587899449906.jpg" class=" img-fluid img-markdown" /> <img src="/assets/uploads/files/1561967044183-photo5821056587899449905.jpg" alt="0_1561967420588_photo5821056587899449905.jpg" class=" img-fluid img-markdown" /><br />
The reason is that I'd like to make something like PoE (my RS485 are connected over CAT7 cable with 2 pairs as power line 12V for nodes) and my RS485-gateway should send to Domoticz status of voltage, summary current and power consumption of my 485-nodes. Because I'd like to use display in vertical (2xDIN case) need to use U8g2lib.h library. It's working ok with constant text but how I can read out vales of NodeManager variable eg.</p>
<pre><code>float voltage = ((ina219*)nodeManager.getSensor(0))-&gt;getValueFloat();
</code></pre>
<p dir="auto">General my question is how can I, in main loop, get value from NodeManager sensors?<br />
Part of my code - compile error (because of variable)</p>
<pre><code>  // call NodeManager before routine
  nodeManager.before();

  u8g2.begin();

   u8g2.firstPage();
   do {
     u8g2.setFont(u8g2_font_helvR10_tf);
     u8g2.drawStr(3,15,"Voltage");
     u8g2.drawStr(3,45,"Current");
     u8g2.drawStr(3,75,"Power");
   } while ( u8g2.nextPage() );
  
  delay(5000);

  u8g2.clear();
 
   u8g2.firstPage();
    do {
     u8g2.drawStr(1, 32, "START");
   } while ( u8g2.nextPage() );

}
</code></pre>
<pre><code>// loop
void loop() {
//  digitalWrite(MY_DEFAULT_ERR_LED_PIN, state);

while (transportCheckUplink() == false){

  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_helvR14_tf); // 14 px height
    u8g2.drawStr(3, 32, "Disconnected!");
    } while ( u8g2.nextPage() );
 }
  
  // call NodeManager loop routine
  nodeManager.loop();
  
  int sensorIna219_Id = nodeManager.registerSensor(ina219);
  float voltage = ((ina219*)nodeManager.getSensor(0))-&gt;getValueFloat();
  float current = ((ina219*)nodeManager.getSensor(1))-&gt;getValueFloat();
  float power = ((ina219*)nodeManager.getSensor(2))-&gt;getValueFloat();  
  
  u8g2.firstPage();
  do {
     u8g2.setFont(u8g2_font_helvR10_tf);
     u8g2.drawStr(3,15,"Voltage");
     u8g2.drawStr(3,45,"Current");
     u8g2.drawStr(3,75,"Power");  
   
  u8g2.setFont(u8g2_font_fub30_tn);
  u8g2.setCursor(3, 35);
  u8g2.print(voltage);
  u8g2.setCursor(3, 70);
  u8g2.print(current);
  u8g2.setCursor(3, 100);
  u8g2.print(power)
 } while ( u8g2.nextPage() );
  
}
</code></pre>
<p dir="auto">I know it's little be chaotic - hope not problem to understand :)</p>
<p dir="auto">B.R.<br />
Adam</p>
<p dir="auto">P.S.<br />
my ArduinoIDE 1.8.9, MySensors 2.3.1 and NodeManager 1.9 dev</p>
]]></description><link>https://forum.mysensors.org/topic/10508/nodemanager-on-stm32f103c8-rs485-gateway-ina219-oled</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 11:45:53 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/10508.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Jul 2019 08:01:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NodeManager on STM32F103C8 - RS485 Gateway + INA219 + OLED on Tue, 24 Sep 2019 12:56:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/adampr1" aria-label="Profile: adampr1">@<bdi>adampr1</bdi></a> sorry for reading this thread only now with so much delay :-/ Nice project btw! Which compilation error are you receiving from Nodemanager? I also wonder if you can leverage Nodemanager's hooks capabilities to interact with it in a more clean way. Thanks!</p>
]]></description><link>https://forum.mysensors.org/post/101424</link><guid isPermaLink="true">https://forum.mysensors.org/post/101424</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Tue, 24 Sep 2019 12:56:19 GMT</pubDate></item></channel></rss>