Skip to content

Troubleshooting

Help! Everything just falls apart
2.7k Topics 21.5k Posts
  • fail converting 1.5 sketch to 2.0

    2
    0 Votes
    2 Posts
    1k Views
    DIYProjectsD
    Hi Carmelo42. Here your sketch modified. You need to define all MySensors parameters before to include the library. I add 2 variables (BATT_IN_PIN, BATT_VCC_PIN). You need to set Pins. I think, it'll run now. I don't check if the measure of the temperature is correct. // avec mesure de la batterie avec Vcc.h // ok avec pile CR2032 et docATmega328 8Mhz MYSBootloader et efuse 0x07 // pour DS18B20 SANS resistance // nécessite la lib OneWire : OneWireNoResistor-master.zip // // boards.txt : //proMYSBL.name=docATmega328 8Mhz MYSBootloader //proMYSBL.upload.tool=avrdude //proMYSBL.upload.protocol=arduino //proMYSBL.upload.maximum_size=30720 //proMYSBL.upload.maximum_data_size=2048 //proMYSBL.upload.speed=115200 //proMYSBL.bootloader.tool=avrdude //proMYSBL.bootloader.low_fuses=0xE2 //proMYSBL.bootloader.high_fuses=0xDA //proMYSBL.bootloader.extended_fuses=0x07 //proMYSBL.bootloader.unlock_bits=0x3F //proMYSBL.bootloader.lock_bits=0x0F //proMYSBL.bootloader.file=MySBootloader/MYSBootloader.hex //proMYSBL.build.mcu=atmega328p //proMYSBL.build.f_cpu=8000000L //proMYSBL.build.board=AVR_UNO //proMYSBL.build.core=arduino:arduino //proMYSBL.build.variant=arduino:standard #define MY_NODE_ID 123 #define MY_RADIO_NRF24 #include <SPI.h> #include <MySensors.h> #include <DallasTemperature.h> #include <OneWire.h> #include <Vcc.h> #define ONE_WIRE_BUS 4 // Pin where dallase sensor is connected #define ONE_WIRE_GND 5 #define ONE_WIRE_VCC 3 #define ID_BatPcnt 1 #define ID_Bat 2 #define BATT_IN_PIN 1 #define BATT_VCC_PIN 2 #define MAX_ATTACHED_DS18B20 16 // 60000 = 1 minute // 12000 = 2 minutes // 300000 = 5 minutes // 600000 = 10 minutes #define SLEEP_TIME 300000 // Sleep time between reads (in milliseconds) const float VccMin = 2.3; // Vcc mini attendu, en Volts. const float VccMax = 3; // Vcc Maximum attendu, en Volts (2 piles AA neuves) const float VccCorrection = 2.52/2.6; // calibration : Vcc mesuré au multimètre / Vcc mesuré par l'Arduino par vcc.Read_Volts() dans sketch 1/2 Vcc vcc(VccCorrection); OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); //MySensor gw; MyMessage msgBAT_PCNT(ID_BatPcnt,V_VAR1); // on utilise le type V_VAR1 pour le % de charge des piles MyMessage msgBAT(ID_Bat,V_VAR2); // on utilise le type V_VAR2 pour la tension des piles float lastTemperature[MAX_ATTACHED_DS18B20]; uint8_t numSensors = 0; boolean receivedConfig = false; boolean metric = true; // Initialize temperature message MyMessage msg(0, V_TEMP); int oldvalue = 0; void before() { // Startup up the OneWire library sensors.begin(); } void setup() { // Startup OneWire #ifdef ONE_WIRE_VCC pinMode(ONE_WIRE_VCC, OUTPUT); digitalWrite(ONE_WIRE_VCC, HIGH); #endif #ifdef ONE_WIRE_GND pinMode(ONE_WIRE_GND, OUTPUT); digitalWrite(ONE_WIRE_GND, LOW); #endif analogReference(INTERNAL); pinMode(BATT_IN_PIN, INPUT); pinMode(BATT_VCC_PIN, OUTPUT); digitalWrite(BATT_VCC_PIN, LOW); } void presentation() { // Startup and initialize MySensors library. Set callback for incoming messages. // gw.begin(); //gw.begin(NULL, node_id, true); // Send the sketch version information to the gateway and Controller sendSketchInfo("TS sR batt", "2.0"); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); sensors.setWaitForConversion(false);//saves a few mAs per read :-) to debug // Present all sensors to controller present(ID_BatPcnt, S_CUSTOM); // type S_CUSTOM pour le capteur "% de charge" present(ID_Bat, S_CUSTOM); // type S_CUSTOM pour le capteur "tension" for (int i = 0; i < numSensors && i < MAX_ATTACHED_DS18B20; i++) { present(i, S_TEMP); } } void loop() { // Process incoming messages (like config from server) //gw.process(); // mesure de Vcc float v = vcc.Read_Volts(); // calcul du % de charge batterie float p = 100 * ((v - VccMin) / (VccMax - VccMin)); // On envoie les données des capteurs et de l'état de la batterie au Gateway //gw.sendBatteryLevel(p); // Inutile... send(msgBAT_PCNT.set(p, 1)); // 1 décimale send(msgBAT.set(v, 3)); // 2 décimales // Fetch temperatures from Dallas sensors // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); sleep(750);//wait for conversion in sleep mode // Read temperatures and send them to controller for (int i = 0; i < numSensors && i < MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric ? sensors.getTempCByIndex(i) : sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error send(msg.setSensor(i).set(temperature, 1)); lastTemperature[i] = temperature; //if (lastTemperature[i] != temperature && temperature != -127.00) { // Send in the new temperature //} } sleep(SLEEP_TIME);//wake on interrupt or after sleep-time } If you need more info : http://www.diyprojects.io/mysensors-v2-discover-news-migrate-old-sketchs/ (or http://www.projetsdiy.fr/mysensors-version2-decouverte-nouveautes-convertir-sketch/ in french)
  • Converting to 2.0 Slim Node as a Mini 2AA Battery PIR Motion Sensor code

    10
    0 Votes
    10 Posts
    3k Views
    Martin TellblomM
    Thanks I'll try that
  • Two pulse power meters on one Arduino

    3
    0 Votes
    3 Posts
    668 Views
    mfalkviddM
    @Pewh yes, that's the way. Great work, and thanks for posting the solution!
  • [Beginner] WS2811 lights just doesn't light up normally

    14
    0 Votes
    14 Posts
    3k Views
    YveauxY
    @Mantvydas-Ri Might be. Data line serves as gnd. But don't operate them like that, things might break!
  • help about error in serial monitor

    3
    0 Votes
    3 Posts
    569 Views
    R
    @hek thank you dear hek
  • RFM69HC doesn't want to send/receive?

    4
    0 Votes
    4 Posts
    2k Views
    M
    @Christoph-Blank said: well - the blog post I used for the wiring missed the detail that the RFM69 does not seem to be 5V tolerant (inputs). Can anyone tell me: a) if it is damaged if the inputs had 5V b) how I can adjust the levels, can I do this with resistors or do I need more? I made the same mistake, while connecting the modules VIN pin to the Arduino's 3.3V rail, I failed to read that the RFM69's pins aren't 5V tolerant. After I figured out how to make another pair of RFM69 modules work together, this time at the correct voltage, I tried the first to if they were fried. They weren't. As soon as I connected them to a 3.3V Arduino they worked like a charm. So it's very likely that yours are fine to. As for the correct wiring, some are using voltage dividers to lower the signal pins voltage down to 3.3V. Others are using logic level converters. Me, I was lucky engough to have a couple of chinese 3.3V Arduino Pro Mini boards ordered a long time ago and never used since. For minimal clutter, I'd suggest using the same setup. The cheapest 3.3V options are the Arduino Pro Mini (my model) but you'll also need some USB to TTL dongles (the ones having a DTR pin) to program them. Or you may use something like: http://www.ebay.com/itm/Pro-Micro-3-3V-8M-5V-16M-atmega328-Replace-ATmega128-Arduino-Compatible-Nano-/172446438226 but notice that this one doesn't use the ATmega328 chip but ATmega32U4 and that will require these lines of code at the top of your sketches: For MySensors 2.0 #define MY_RF69_SPI_CS 8 #define MY_RF69_IRQ_PIN 7 #define MY_RF69_IRQ_NUM 4 For MySensors 2.1.0beta (RSSI report added amongst a lot of other improvements) #define MY_RFM69_SPI_CS 8 #define MY_RFM69_IRQ_PIN 7 #define MY_RFM69_IRQ_NUM 4 Note the slight difference between the two.
  • This topic is deleted!

    2
    0 Votes
    2 Posts
    44 Views
    No one has replied
  • ESP8266/Wemos D1 Mini with RFM69?

    1
    0 Votes
    1 Posts
    895 Views
    No one has replied
  • Add a Sketch to the library. How do u do it?

    1
    0 Votes
    1 Posts
    556 Views
    No one has replied
  • Stepper don't work with Mysensors library

    4
    0 Votes
    4 Posts
    1k Views
    TON RIJNAARDT
    @mfalkvidd Tanks for the help i give it atry. I am new to arduino so maby i need more help. I let you now when it is nessesary. Greatz Ton
  • RFID Reader ID-3LA

    9
    0 Votes
    9 Posts
    2k Views
    mfalkviddM
    @jeti great work!
  • Wiegand sending codes to domoticz

    6
    0 Votes
    6 Posts
    3k Views
    mfalkviddM
    I think the post @AWI was referring to is https://forum.mysensors.org/topic/1957/lcd-clock-and-text-sensor-node-with-new-v_text/11
  • Not able to add sensors as device in Domoticz

    3
    0 Votes
    3 Posts
    801 Views
    ohjeeO
    Thank you, you made my day! Everything works fine now (told you I was a beginner! :))
  • Node - Gateway communication issues

    2
    0 Votes
    2 Posts
    814 Views
    M
    It seems that adding: #define MY_PARENT_NODE_IS_STATIC is of some help, however I did noticed a large increase in TX time even though i set boolean requestACK = false; So the whole protocol appears to resemble more with TCP rather than UDP. All things considered I believe the remote battery powered nodes should be able to successfully recover from a temporarily gateway failure without increasing their TX time substantially. The TNR state is excellent when it comes to TX time during gateway failure but it misses a mechanism to automatically recover from this state once the gateway is back. ** MY_PARENT_NODE_IS_STATIC** allows for recovery but at the expense if doubling the TX time. So in production you either manually reset all sensor nodes after a gateway failure, or you take immediate action to minimize the impact on the sensors batteries.
  • Ethernet Gateway not working with Vera..

    3
    1 Votes
    3 Posts
    950 Views
    borgejeB
    [image: IMG_2762.jpg] [image: IMG_2759.jpg]
  • Using MySensors feature in a library

    1
    0 Votes
    1 Posts
    383 Views
    No one has replied
  • Please check my mysensors code.

    9
    0 Votes
    9 Posts
    2k Views
    M
    @mfalkvidd Thanks heaps, enjoy your trip =)
  • Error : Reconnection the sensors when gateway was down and pass to up

    1
    0 Votes
    1 Posts
    257 Views
    No one has replied
  • Unstable radio connection.

    fpar radio nrf2401 nack
    5
    1 Votes
    5 Posts
    3k Views
    NikitaN
    @Boots33 Thanks for advice! I will definitely get some extra non amplified nrf modules and think about having a separate power supply for my radio.
  • 0 Votes
    5 Posts
    2k Views
    non_avg_joeN
    @tekka: Thanks For All Your Efforts, Buddy ! :) @Mickey: Not Yet, Although I Plan On Utilizing [ https://github.com/tzapu/WiFiManager ] & a Similar Example Is Included There - https://github.com/tzapu/WiFiManager/blob/master/examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino + https://github.com/tzapu/WiFiManager/blob/master/examples/OnDemandConfigPortal/OnDemandConfigPortal.ino

14

Online

11.7k

Users

11.2k

Topics

113.1k

Posts