Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. NodeManager
  4. NodeManager on STM32F103C8 - RS485 Gateway + INA219 + OLED

NodeManager on STM32F103C8 - RS485 Gateway + INA219 + OLED

Scheduled Pinned Locked Moved NodeManager
2 Posts 2 Posters 1.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adampr1
    wrote on last edited by
    #1

    Hi all,
    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.
    2_1561967420588_photo5821056587899449907.jpg 1_1561967420588_photo5821056587899449906.jpg 0_1561967420588_photo5821056587899449905.jpg
    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.

    float voltage = ((ina219*)nodeManager.getSensor(0))->getValueFloat();
    

    General my question is how can I, in main loop, get value from NodeManager sensors?
    Part of my code - compile error (because of variable)

      // 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() );
    
    }
    
    // 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))->getValueFloat();
      float current = ((ina219*)nodeManager.getSensor(1))->getValueFloat();
      float power = ((ina219*)nodeManager.getSensor(2))->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() );
      
    }
    

    I know it's little be chaotic - hope not problem to understand :)

    B.R.
    Adam

    P.S.
    my ArduinoIDE 1.8.9, MySensors 2.3.1 and NodeManager 1.9 dev

    1 Reply Last reply
    0
    • U Offline
      U Offline
      user2684
      Contest Winner
      wrote on last edited by
      #2

      @adampr1 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!

      1 Reply Last reply
      1

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      14

      Online

      12.1k

      Users

      11.2k

      Topics

      113.4k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular