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. Sensor ID Code display

Sensor ID Code display

Scheduled Pinned Locked Moved Development
1 Posts 1 Posters 857 Views 1 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.
  • L Offline
    L Offline
    lafleur
    wrote on last edited by lafleur
    #1

    I use this code header on my project to ID the code in a given device... you might find it useful in your projects...
    I use primarily, Moteino and MoteinoMega or equiv with RFM69 radios on my projects...

    It outputs an hello message to the serial port, with file name, compile date, time, sensor version number and node information

    /*  Enable debug prints to serial monitor on port 0 */
    #define MY_DEBUG            // used by MySensor
    
    #define SKETCHNAME "Water and Pressure Meter"
    #define SKETCHVERSION "1.2c"
    
    #define MY_RFM69_NETWORKID 200   // Network ID, unique to each network, production = 100, test = 200 
    #define MY_NODE_ID 7                            // My Sensor Node ID real = 6, 7 = test  
    
    
    void setup()  
    {  
      // initialize serial communication at 115200bits per second:
      Serial.begin(115200);
    
    #ifdef __AVR_ATmega1284P__      // use for Moteino Mega Note: LED on Mega are 1 = on, 0 = off
      debug(PSTR("** Hello from the Water Meter on a MoteinoMega **\n") );
      #else                         // we must have a Moteino
      debug(PSTR("** Hello from the Water Meter on a Moteino **\n") );
    #endif
    
      const char compile_file[]  = __FILE__ ;
      debug(PSTR(" %s %s\n"), SKETCHNAME, SKETCHVERSION);
      debug(PSTR(" %s \n"), compile_file);
      const char compile_date[]  = __DATE__ ", " __TIME__;
      debug(PSTR(" %s \n\n"), compile_date);
      debug(PSTR(" Network ID: %u  Node ID: %u\n\n"), MY_RFM69_NETWORKID, MY_NODE_ID);
    
    // your code as needed......
    
    }
    
    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


    13

    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