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!
  • What are these bad practices ?

    11
    0 Votes
    11 Posts
    2k Views
    scalzS
    @FotoFieber maybe. i've not got this case yet. if i remember visualmicro use arduino core and boards. and both use the gcc toolchain; then i've not checked how it's compiled sure.. visualmicro still works nice for me. but i also use arduino ide ;)
  • MAX6675

    temperature
    14
    0 Votes
    14 Posts
    8k Views
    W
    If you are not going to use mysensors look at library example https://github.com/mcleng/MAX6675-Library/blob/master/examples/read_temp/read_temp.pde Error: MAX6875Temp.ino: In function 'void loop()': MAX6875Temp:24: error: 'class MAX6675' has no member named 'read_temp' temperature = temp.read_temp();
  • Interrupt and sleep

    26
    0 Votes
    26 Posts
    11k Views
    gohanG
    @giovaFr if you are referring to sleep(dht.getMinimumSamplingPeriod()); that was straight from the example of the DHT11 sensor.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    2 Posts
    647 Views
    hekH
    Request of I_BATTERY_LEVEL is currently not supported (none of the internal commands is passed to the sketch receive-function). But you could do a little hack by implementing receive() {} and call sendBatteryLevel (...) when you receive a command of your choice.
  • A Basic domestic 240v light and switch.

    8
    0 Votes
    8 Posts
    3k Views
    el tigroE
    1485777547: Sending PINGRESP to mysensors-1 1485777562: Received PINGREQ from mysensors-1 1485777562: Sending PINGRESP to mysensors-1 1485777563: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) 1485777563: Sending PUBLISH to home-assistant-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) 1485777565: Received PUBLISH from mysensors-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) 1485777565: Sending PUBLISH to home-assistant-1 (d0, q0, r0, m0, 'mygateway1-out/5/25/1/0/16', ... (1 bytes)) This is the mqtt log for one on / off cycle.
  • ESP8266 MQTT gateway + sonoff_MQTT code + vera + HA_Bridge + Alexa, oh my

    9
    0 Votes
    9 Posts
    6k Views
    S
    Switches working well but I can't get Temperature to update on a device. When switching on a sonoff locally it sends mygateway1-in/20/10/1/1/2/1 to the MQTT broker, which immediately causes the switch on the device in Vera to show on, this is passed back out and is sent back to the sonoff. However I cannot get a temperature device to update. I send mygateway1-in/50/1/1/0/0/20.70 to the Broker but get no change. I can send an html command to update the temp fine. here is the Vera device parameters. [image: veradevice.PNG] I have tried sending to the in and the out topic just to be sure. Does anyone have a log from an actual temp node showing the message passed to the gateway just in case someting is not right with my message? Also is there a way to monitor the serial messages passed into the Vera from the gateway to check the messages are passing?
  • MoteinoMEGA on 2.0.1 error compiling

    12
    0 Votes
    12 Posts
    3k Views
    tekkaT
    @alexsh1 See here and the comments therein, this is not a MySensors issue: https://github.com/mysensors/MySensors/issues/665
  • HELP!! NODE WITH RELAY VOLTAGE AND DETECTOR

    4
    0 Votes
    4 Posts
    1k Views
    L
    @Marco-Avallone Please use the code syntax for your code snipet. Like this it's very hard to read. Also why do you use caps so much? For me your question isn't clear. What have you tried to actually do that did not work? for 1: just add another child to your sketch for another relay... basically duplicate most of your code for 2: then safe the last state and check it before sending a message Hope that helped.
  • Use dev branch in controller, release for nodes?

    3
    0 Votes
    3 Posts
    937 Views
    pansenP
    thanks @mfalkvidd , I'll post again if I run into problems!
  • Most reliable light switch

    4
    0 Votes
    4 Posts
    2k Views
    Boots33B
    @Alexander-Ivanov The information in these posts may be of use. mys-library-startup-control-after-onregistration my_transport_dont_care_mode In mySensors V2.1 the basic sketch for a switch that will work even if the controller/gateway is down would look something like this // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 #define MY_TRANSPORT_WAIT_READY_MS 3000 //set how long to wait for transport ready. #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> #define RELAY_PIN 4 // Arduino Digital I/O pin number for relay #define BUTTON_PIN 3 // Arduino Digital I/O pin number for button #define CHILD_ID 1 // Id of the sensor child #define RELAY_ON 1 #define RELAY_OFF 0 Bounce debouncer = Bounce(); int oldValue = 0; bool state; MyMessage msg(CHILD_ID, V_STATUS); void setup() { pinMode(BUTTON_PIN, INPUT); // Setup the button pin digitalWrite(BUTTON_PIN, HIGH); // Activate internal pull-up // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); pinMode(RELAY_PIN, OUTPUT); // set relay pin in output mode digitalWrite(RELAY_PIN, RELAY_OFF); // Make sure relay is off when starting up } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay & Button", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_BINARY); } void loop() { debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue && value == 0) { // check for new button push state = !state; //Toggle the state send(msg.set(state), false); // send new state to controller, no ack requested digitalWrite(RELAY_PIN, state ? RELAY_ON : RELAY_OFF); // switch the relay to the new state } oldValue = value; } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type == V_STATUS) { state = message.getBool(); // get the current state digitalWrite(RELAY_PIN, state ? RELAY_ON : RELAY_OFF); // switch relay to current state // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
  • Max6675 Thermocouple project

    2
    0 Votes
    2 Posts
    2k Views
    M
    Any ideas on this any one? How to troubleshoot this? Would be nice to get this working. Thanks W.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Combine Servo with dual switch for controlling blinds

    1
    1 Votes
    1 Posts
    914 Views
    No one has replied
  • rfm69 and atc

    49
    2 Votes
    49 Posts
    16k Views
    scalzS
    @cablesky it is not included in Mysensors yet as it breaks compatibility with current packet protocol. It's planned in an upcoming release, and working well ;)
  • Dust Sensor (1.4)

    26
    0 Votes
    26 Posts
    24k Views
    Tore André RosanderT
    Does anyone have info on how to wire the GP2Y1010AU0F? My cable is almost the same as on the picture https://www.mysensors.org/build/dust The red, black and yellow is in the same place, but from there it goes white, green, blue. EDIT: Found that Red is vcc, black is signal and yellow is ground. Do this sensor need calibration? And what is considered a high value for dust? And is it only those three wires that needs to be connected to the arduino? Not the led?
  • RFM95W MODEM_CONFIGRUATION

    11
    0 Votes
    11 Posts
    3k Views
    M
    Well, this makes sense. And after all, if you're smart enough to tweak the lib and bypass the restrictions, chances are you know what you're doing both with the coding and with the radio spectrum.
  • This topic is deleted!

    5
    0 Votes
    5 Posts
    103 Views
  • ATmega328P + wireless modules + Raspberry Pi = Full domotic solution ?

    10
    0 Votes
    10 Posts
    2k Views
    gohanG
    If you could post more details about your project maybe someone could come up with some advices. Also as a general rule try to choose a solution that you see there are libraries already made and people using it, otherwise if you go full DIY and you have issues, you are on your own.
  • ESP8266 (WeMos) as serial gateway

    1
    0 Votes
    1 Posts
    658 Views
    No one has replied

8

Online

11.7k

Users

11.2k

Topics

113.1k

Posts