Skip to content

Development

Discuss Arduino programming, library tips, share example sketches and post your general programming questions.
1.5k Topics 13.5k Posts

Subcategories


  • 56 578
    56 Topics
    578 Posts
    HJ_SKH
    Hi2All! Surprising is here. After about 24hours I refresh HA and suddenly my motion sensor was integrated. There is also second entity > battery : 0 , have to look deeper into that for understanding. Need to change little in the sketch, because don't want every short time 'no movement' so only when there is motion and maybe once a hour indication sensor is alive. Meantime I found 3 other good threats: https://forum.mysensors.org/topic/11200/finally-progress-evidence-based-radio-testing-method-and-capacitors https://forum.mysensors.org/topic/1664/which-are-the-best-nrf24l01-modules/27 https://forum.mysensors.org/topic/9550/build-a-reliable-power-supply-chain Very usefull for me also finally progress because of lacking time in the past. Great jobs are done here! Thanks for this all of you guys or girls!
  • Comissioning a network, PAN-ID, Frequency selection ??

    comissioning
    6
    0 Votes
    6 Posts
    2k Views
    G
    Ahh -- Yes I recall now, same problem on the SI44xx chips. So maybe a "bind" mode that uses a know fixed ID (maybe all F's) in conjunction with a random PAN_ID that is compiled into the gateway only. The randomness is controlled by the build process or it could be a sequenced number etc. Bind mode on the gateway would use the known fixed ID and it would only respond to GetPan_ID requests from nodes. The mode would be entered during boot, detected by a button press or jumper. The gateway would not exit bind mode until it is rebooted with the jumper removed. The end/router nodes would be built with the fixed ID programmed in the EEprom (hence all F's) and would therefore know that it has not gotten a PAN_ID yet. It would then enter a loop asking for a PAN_ID from the gateway, using said fixed ID . The end/router node would indicate a successful exchange of the PAN_ID by setting it's LED (on PB5/SCK ) and entering an indefinite loop after storing the PAN_ID in the eeprom. The end/router would have an option to ease the EEPROM during the boot of the node by detecting a switch closure or jumper to force a rebind to a different network. So from a user's point of view to bind a node you place a jumper on the gateway and the node then power both. Wait until you get a green light on the node. at which point you remove the jumpers and reset both. When playing with the PAN ID yesterday I noticed that the lower 8 bits (I think) showed some strange behavior. Is the library using the data pipes, and therefore 7:0 is not actually usable in the PANID? Gary
  • change node ID (i.e. in case of conflict)

    9
    0 Votes
    9 Posts
    5k Views
    tekkaT
    @pit007 This is pretty cool, thanks for sharing.
  • get a string out of a payload

    getcustomstring string getstring
    17
    0 Votes
    17 Posts
    5k Views
    M
    I'm writing a sketch that use a MEMS sensor (ADXL345 in this case but it will be a start point for more sensors like this like MPU6050). this chip can raise an interrupt when: inactivity sensed,activity sensed,tap,double tap,free fall. so the reading of the XYZ values with a leading char that represent the event sensed (I for inactivity and etc ) are going to a serial MySensor GW and from there to the controller (right now I'm using MYSController). *EDIT I found out that values can be negative so I just sending the decimal numbers as is...
  • using 2 interrupt pins (2,3) inside a node.

    interrupt pins
    3
    0 Votes
    3 Posts
    2k Views
    M
    ooouuu sorry missed that....(you really thought on everything with this library....)
  • 0 Votes
    4 Posts
    3k Views
    tbowmoT
    @funky81 the original question was, if you could connect the supply to Vraw (using 3xAA batteries), and still use the internal Vref to calculate batteryvoltage. This is not possible Your approach is connecting battery directly to VCC on the atmega (bypassing the onboard voltage regulator). In this case it will work.
  • Getting childId from IncomingMessage

    6
    0 Votes
    6 Posts
    3k Views
    BulldogLowellB
    @vikasjee you should post your entire sketch... put between three backticks (the character left of your "1" key on you keyboard <three backticks> your code <three backticks>
  • Battery powered IR sender

    slight gw.sleep infrared blaster
    6
    0 Votes
    6 Posts
    3k Views
    KytrixK
    Ok, I was thinking that I could ask the state of the message S_LIGHT at every wake up, and if it changes, do my IR sending ... But it seems to not work. I guess for this, the problem is on the controller side, after send the command, without acknowledge , it give up and let the state of the button unchanged. Always on means power supply, This sensor must also get temperature, so I don't want to put it anywhere ... anyway thanks for you help :)
  • eeprom address for node id

    eeprom node id
    2
    1 Votes
    2 Posts
    2k Views
    hekH
    If you use the MySensors provided functions (saveState) you can store 256 bytes without overwritnig anything.
  • Help sending payload with more decimal places

    5
    0 Votes
    5 Posts
    2k Views
    hekH
    @therik said: gw.send(msgVolt.set(batteryV, 2),1); Yes, this is correct.
  • Need help sending custom values

    5
    0 Votes
    5 Posts
    2k Views
    BulldogLowellB
    @Chaotic good, let us know if you need any assistance... Note I noticed that I had an error in the code above and I updated it for you. Sorry 'bout that.
  • Otabootloader upload ?

    14
    0 Votes
    14 Posts
    4k Views
    tekkaT
    @Dheeraj Did you install the most recent version of the library? There were some significant changes in the routing and find_parent parts of the code...
  • sending sensor reading with more than one value

    multiple values accelearometer
    5
    0 Votes
    5 Posts
    2k Views
    M
    @hek said: ...or pack your data into VAR_1. can you give an example?
  • How to know the node ids assigned by the mqtt gateway to the sensors?

    11
    1 Votes
    11 Posts
    6k Views
    D
    @amitach said: Hi, I have a mqtt gateway running on arduino from mysensors library. I also have an openhab controller running on a raspberry pi connected to the arduino uno through the ethernet shield. I am trying to create my first item on openhab and I understand that the format required is MyMQTT/20/0/V_TEMP where 20 and 0 are node id and sensor id respectively. I can see following message on the serial monitor Started! 0;0;3;0;9;read: 20-20-0 s=1,c=1,t=16,pt=0,l=1:1 How do I configure the node id and the sensor id? Is it assigned automatically or do I assign it statically? How do I understand the above output on the serial monitor? You can let the gateway autoassign node IDs or take it in your own hands. What I found useful is to not rely on the automatic assignment but give my nodes a static ID, you can do that by replacing the gw.begin function call by this: gw.begin(NULL, NODE_ID, false); where NODE_ID is your chosen ID (you can use "#define NODE_ID 12" for example to specify it before). The sensor ID is specified by you. So in each example you see a line something like this: MyMessage msgMotion(CHILD_ID_MOTION, V_TRIPPED); where the first argument (here CHILD_ID_MOTION) specifies the sensor ID that will be sent along your message. You can, again, use #define to define a number in the top of your sketch. The serial output was a mystery to me as well until I looked up the printout in the libraries/MySensors/MySensors.cpp file. It's constructed like this: debug(PSTR("read: %d-%d-%d s=%d,c=%d,t=%d,pt=%d,l=%d:%s\n"), msg.sender, msg.last, msg.destination, msg.sensor, mGetCommand(msg), msg.type, mGetPayloadType(msg), mGetLength(msg), msg.getString(convBuf)); So it's the sender's node ID, then probably the next hop's node ID, then the destination's node ID, then s=sensor ID, command type?, the message type (like V_TRIPPED, but as a number), payload type, length of the message, the message itself.
  • Eeprom access via mySensors

    read management eeprom write structured
    9
    0 Votes
    9 Posts
    4k Views
    klimK
    thanks, i'll give it a try.
  • Adding new board definitions to arduino 1.6

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Port of MySensors Library 1.4 to Raspberry

    raspberry 1.4
    10
    0 Votes
    10 Posts
    4k Views
    S
    Hello Guys , I am looking to run the rasp pi as gateway+controller with the nrf24 . Please where should i start from does it have any explanation like we have for the arduino s running mysensor ? .
  • Mutiple sensors with Interrupt

    4
    0 Votes
    4 Posts
    2k Views
    BulldogLowellB
    @mainali It would be easier if you showed the type of sensor, but basically, you would be constantly reading its output, and reflecting changes between HIGH and LOW (if it has digital output) or using analog thresholds.
  • 0 Votes
    3 Posts
    2k Views
    R
    hello, are novice with mysensor and Arduino, I am interested in your solution to recover data from the nodes transmissible. you can see some examples. thank you very much.
  • Help needed to extend binary sensor to multiple switches

    2
    0 Votes
    2 Posts
    1k Views
    BulldogLowellB
    @chuckconnors said: is there an easy way to test all switches as a binary number yes, with direct port manipulation you can do this. Polling Port Registers (you should be able to use 0-7 (PORTD), with the standard MySensors radio attachment) play with that and let us know if you need help...
  • Node to Node communication

    15
    0 Votes
    15 Posts
    10k Views
    K
    I figured that out from the other thread :) I added this little helper to my copy of MySensors.cpp: void MySensor::wait(unsigned long ms) { bool slept_enough = false; unsigned long start = millis(); unsigned long now; // Let serial prints finish (debug, log etc) Serial.flush(); while (!slept_enough) { MySensor::process(); now = millis(); if (now - start > ms) { slept_enough = true; } } } In theory it'll handle the millis() rollover, but I haven't verified yet. I'm now able to send messages between nodes with and without being in repeater mode. I have yet to test repeater mode, as i haven't convinced a sensor it can't see the gw yet :)

16

Online

11.7k

Users

11.2k

Topics

113.0k

Posts