Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. MasMat
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    MasMat

    @MasMat

    15
    Reputation
    145
    Posts
    912
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Location Helsinki, FI Age 43

    MasMat Follow

    Best posts made by MasMat

    • RE: Sensor dht+relay won't send data or present

      To follow up. It was hardware: broken vcc pin on the dht11 corrupted the whole sensor code badly. Resolder and added wait-code, inverted the on-off 0-vs-1 and I have a good working sensor. The duplicate is also installed and working reliably.
      A 6-relay board is also working nicely and Domoticz is great. My old system is nearly replaced and I couldnt be happier.

      Respect and thanks all around!

      posted in Troubleshooting
      MasMat
      MasMat
    • RE: AnalogRead problem

      @Yveaux and @boum You two beat me by 2hrs.
      @user2684 whose code this is (cudos to him, have used this bit on a number of sensors!) had probably figured that out and I screwed myself when I changed the original analogRead to int.

      Now the whole thing works 100%

      posted in Troubleshooting
      MasMat
      MasMat
    • RE: 💬 Building a Raspberry Pi Gateway

      @gohan N00b question, but which steps from the step-by-step need to be redone to "compile it" after altering myconfig.h? Or can you just post the command lines? 😳

      posted in Announcements
      MasMat
      MasMat
    • RE: [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5

      I have now. I always have that nagging feeling...
      But after MANY iterations, finally success. At least partly. ✌

      BlinkWithoutDelay works AND mysensors sketch as well (will do more testing...).
      What made it work, if anyone else struggles with this:

      -connect uno (to computer-linux), board:uno, upload ArduinoISP, disconnect
      -add shield to uno and atmega328p-pu to shield, connect to computer, board: "8mhz on breadboard", "programmer: "Arduino as ISP", burn bootloader, disconnect
      -board: Uno, connect as above, "upload sketch using programmer", disconnect EDIT this last part appears to work but internal clock is all messed up. Bootloader works fine like this.

      The magic happened after I changed the board back to Uno after burning bootloader. Why is beyond me, but maybe some arduino-ninja can figure it out.

      posted in Development
      MasMat
      MasMat
    • RE: [SOLVED]Two nodes with relays interfering

      Nevermind. Whined too soon.
      Completely worked over the node4 code, moved "include"s around and eventually changed the relay presentations and receive clauses. Hope this helps someone with their problems later:
      Thanks a millions!

      void before()
      {
          // Set relay pin in output mode
          pinMode(RELAY_1, OUTPUT);
          // Set relay to last known state (using eeprom storage)
          digitalWrite(RELAY_1, loadState(CHILD_ID_RELAY)?RELAY_ON:RELAY_OFF);
      }
      
      later this....
      
      present(CHILD_ID_RELAY, S_BINARY);
      
      
      ....and ending with this...
      
      void receive(const MyMessage &message)
      {
      if (message.type==V_STATUS) {
          if (message.destination == MY_NODE_ID) { // Only switch the relay if the message is for this node
              Serial.print("Updating relay state");
              // Change relay state
              digitalWrite(RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
              // Store state in eeprom
              saveState(CHILD_ID_RELAY, message.getBool());
              // Write some debug info
          }
          // Write some debug info
          Serial.print("Incoming change for sensor:");
          Serial.print(message.sensor);
          Serial.print(", New status: ");
          Serial.println(message.getBool());
      }
       
      }
      
      
      posted in Troubleshooting
      MasMat
      MasMat
    • RE: 💬 Building a Raspberry Pi Gateway

      @anticimex I've built a new node, DHT11 that sends temp&hum data. I reconfigured Rpi with this:

      sudo ./configure --my-transport=nrf24 --my-rf24-irq-pin=15 --my-signing-debug --my-signing=password --my-signing-password=XXXXXX --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-user=YYYY --my-mqtt-password=ZZZZZ --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mygateway1 --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18
      

      This is what I get in gw syslog:

      Apr  2 22:53:11 DietPi mysgw: Starting gateway...
      Apr  2 22:53:11 DietPi mysgw: Protocol version - 2.2.0
      Apr  2 22:53:11 DietPi mysgw: MCO:BGN:INIT GW,CP=RNNGLSQX,VER=2.2.0
      Apr  2 22:53:11 DietPi mysgw: !SGN:BND:PWD<8
      Apr  2 22:53:11 DietPi mysgw: !SGN:INI:BND FAIL
      Apr  2 22:53:11 DietPi mysgw: TSF:LRT:OK
      Apr  2 22:53:11 DietPi mysgw: TSM:INIT
      Apr  2 22:53:11 DietPi mysgw: TSF:WUR:MS=0
      Apr  2 22:53:11 DietPi mysgw: TSM:INIT:TSP OK
      Apr  2 22:53:11 DietPi mysgw: TSM:INIT:GW MODE
      Apr  2 22:53:11 DietPi mysgw: TSM:READY:ID=0,PAR=0,DIS=0
      Apr  2 22:53:11 DietPi mysgw: MCO:REG:NOT NEEDED
      Apr  2 22:53:11 DietPi mysgw: MCO:BGN:STP
      Apr  2 22:53:11 DietPi mysgw: MCO:BGN:INIT OK,TSP=1
      Apr  2 22:53:11 DietPi mysgw: GWT:RMQ:MQTT RECONNECT
      Apr  2 22:53:11 DietPi mysgw: connected to 127.0.0.1
      Apr  2 22:53:11 DietPi mysgw: GWT:RMQ:MQTT CONNECTED
      Apr  2 22:53:11 DietPi mysgw: GWT:TPS:TOPIC=mysensors-out/0/255/0/0/18,MSG SENT
      Apr  2 22:53:23 DietPi mysgw: TSF:MSG:READ,99-99-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
      Apr  2 22:53:23 DietPi mysgw: TSF:MSG:BC
      Apr  2 22:53:23 DietPi mysgw: TSF:MSG:FPAR REQ,ID=99
      Apr  2 22:53:23 DietPi mysgw: TSF:PNG:SEND,TO=0
      Apr  2 22:53:23 DietPi mysgw: TSF:CKU:OK
      Apr  2 22:53:23 DietPi mysgw: TSF:MSG:GWL OK
      Apr  2 22:53:23 DietPi mysgw: SGN:SKP:MSG CMD=3,TYPE=8
      Apr  2 22:53:23 DietPi mysgw: TSF:MSG:SEND,0-0-99-99,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
      Apr  2 22:53:25 DietPi mysgw: TSF:MSG:READ,99-99-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
      Apr  2 22:53:25 DietPi mysgw: SGN:SKP:MSG CMD=3,TYPE=24
      Apr  2 22:53:25 DietPi mysgw: TSF:MSG:PINGED,ID=99,HP=1
      Apr  2 22:53:25 DietPi mysgw: SGN:SKP:MSG CMD=3,TYPE=25
      Apr  2 22:53:25 DietPi mysgw: TSF:MSG:SEND,0-0-99-99,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1
      Apr  2 22:54:18 DietPi mysgw: TSF:MSG:READ,99-99-0,s=1,c=3,t=16,pt=0,l=0,sg=0:
      Apr  2 22:54:18 DietPi mysgw: SGN:SKP:MSG CMD=3,TYPE=16
      Apr  2 22:54:18 DietPi mysgw: !SGN:NCE:GEN
      Apr  2 22:54:23 DietPi mysgw: TSF:MSG:READ,99-99-0,s=0,c=3,t=16,pt=0,l=0,sg=0:
      Apr  2 22:54:23 DietPi mysgw: SGN:SKP:MSG CMD=3,TYPE=16
      Apr  2 22:54:23 DietPi mysgw: !SGN:NCE:GEN
      

      This is kicking my butt... I cant understand that last part about the nonce 😞
      I will add the code from the node as soon as possible.

      posted in Announcements
      MasMat
      MasMat
    • RE: mysgw MQTT Issues

      Just a quick idea: are you powering the RFM69 from the Rpi?
      I use a Rpi Zero W and when I powered my radio NRF24 from that it doesnt get enough juice even with caps.
      I now use a bigger USB-wall wart and use AMS1117-3.3 to power the radio (PA-version) and added caps.

      My two cents

      posted in Troubleshooting
      MasMat
      MasMat
    • RE: 💬 Building a Raspberry Pi Gateway

      @mfalkvidd Made the password 10 characters. From looks of the logs, it's working now.
      I cant believe I skipped the step of making the password longer... Just got too fixated on the password I came up with.

      posted in Announcements
      MasMat
      MasMat
    • RE: RPi gw broken, invalid message length

      Apparently sleeping less and debugging late solves problems. This is SOLVED.

      My IDE library was outdated. I updated my Arduino Mysensors-library, upload to one node, and my node started to communicate fine. Must reupload all nodes unfortunately. Probably the problems are caused by signing differences in previous library versions vs. 2.3.0 release for Raspberry.

      Again, hope this helps someone who encounters the same problem.

      posted in Troubleshooting
      MasMat
      MasMat
    • RE: 💬 Building a Raspberry Pi Gateway

      @ej3-martin My LEDs come on when the Rpi boots (is that what you mean by testing?). Also you can invert the LEDs (on but blink off) if you want. I figured the wiring makes for better power delivery rather than feeding voltage from the GPIO

      posted in Announcements
      MasMat
      MasMat

    Latest posts made by MasMat

    • RE: Measure multiple voltages

      Check. Gotta redesign.
      I'll get optos on the AC-voltages and power the Rpi from the 48/12V ground source.

      Thanks for confirming my doubts.

      posted in Troubleshooting
      MasMat
      MasMat
    • RE: Measure multiple voltages

      If the grounds are connected: you mean I could connect them. Is it a bad idea?
      When I really look at my goals, measuring is necessary only for the 48V line.
      All the others I can get by with a on/off-info. Optocouplers for 240v data maybe?
      The 48v and 12v probably have common ground considering the dc-dc converter? I'm not familiar with their design.

      posted in Troubleshooting
      MasMat
      MasMat
    • Measure multiple voltages

      I need help with my build. I had what I thought was a great idea but now I'm having doubts & regrets.

      I want to

      1. monitor the utility power (three phase. L1, L2, L3)
      2. monitor solar inverter power (single phase)
      3. monitor solar battery 48+ V
      4. monitor 12V power supply (DC-DC 48=>12V)
      5. send alarms if any are down & return back up
      6. have six green leds on in a dash when all is clear - extra orange and red led for alarm states

      The 240Vs each have a plug and a wall wart/phone charger plugged in.
      I built a thru-hole pcb with 6 LEDs and voltage dividers for each power supply.
      A Rpi Zero + MCP3008 reads the voltage dividers.
      I connected the grounds (neg wires) on the chargers (4x) and hooked it to the pcb. I have leds light up. The 48v and 12v however don't light the leds (their gnd is not connected). The MCP3008 is not reading (the code could be wrong - just did a quick test).

      As I was thinking about this, I got worried.
      Can I connect all the grounds together (4x wall plug, 48V and 12V) ?
      If not, what would be a good way to accomplish what I'm trying to do? I would like to read at least the solar battery voltage (40-57V) beacause that changes. The others can be on/off-type.

      Any help or advice is appreciated!

      posted in Troubleshooting
      MasMat
      MasMat
    • RE: Smart doorbell

      OK. The fstab has credentials file and username password - I recommend picking one. Cred file probably more secure (but permission issues may arise again).

      What I like to do is add my own log entries (into a logfile of my own - not syslog) into the script - to begin with, it logs all kinds of steps the program goes thru. That way I can figure out what makes it stuck - or go crazy otherwise. Then remove all the crazy logging once the script works.
      Example from a shell script of mine of one of many lines marking up whatever steps:
      echo "date -u InetReboot script" >> /home/pi/reboots.log

      "Camera taking pictures constantly" does sound like bouncing..? Reading the button? Could be hardware. Maybe slow down the script also - add "time.sleep(50)" at the end?
      I'm not sure but does python need the GPIO-definitions at the beginning?
      i.e.:
      import RPi.GPIO as GPIO
      GPIO.setmode(GPIO.BOARD)
      and maybe add a pullup/pulldown depending on your wiring.

      posted in My Project
      MasMat
      MasMat
    • RE: Smart doorbell

      Just some things to check (I'm NOT a linux ninja):
      -crontab: why do "sudo crontab -e"? Would using just "crontab -e" use pi-users crontab and have less conflicting permissions?
      -fstab has multiple credentials currently
      -the launcher I believe has unnecessary lines (the changing directories)
      -did you have multiple pythons? (bbt.py, doorbell.py?)

      Just my two cents. Most of my problems are like this or permissions issues that just take too damn long to figure out.

      posted in My Project
      MasMat
      MasMat
    • RE: Roller shutter(s_cover) on Domoticz

      Old thread, I know. Anybody know if this was ever fixed? I can get by with just open/close but percentage would be extra snazzy.

      I'm using a 12V dc motor and microswitches at limit points. The blind is just SO heavy/dragging that I had to get a beefy DC motor. The apparatus moves nicely. Just the control circuitry to do.

      posted in Domoticz
      MasMat
      MasMat
    • RE: [Tutorial] How to burn 1Mhz & 8Mhz bootloader using Arduino IDE 1.6.5-r5

      @FIRE-FOX The answer depends a little on what OS you're using.
      In linux I have an Arduino-folder where the program files (not necessarily the sketches) are AND a hardware folder. Also on OSX I have an Arduino-folder (where I have my sketch-directories and libraries and hardware.
      Locate the hardware-folder (use whatever search-option your OS has) and you can pretty easily figure out where the breadboard-directory goes.

      I wish you luck with the bootloader programming. I went crazy a couple of times but once I got the routine down, it's worth the trouble.

      posted in Development
      MasMat
      MasMat
    • Voltage Sensors wrong and no Onewire

      Hi,

      I need more eyes and help with code on this.
      I have a solar battery (6S Li-ion, Nissan Leaf cells) and I want to monitor voltages, temps and (later) control a safety relay/contactor. The Arduino (3.3v pro mini is powered by a adjustable step down converter set to 3.65V -- just couldnt get 3.3V no matter how closely I turned the knob).
      The voltages come out wrong (1M+100kOhm dividers) - even with a multiplier to even it out. The DS18B20's dont register at all (with simple example sketches they read fine!).

      Measured at battery and at voltage divider:
      4,01 - 0,353
      8,02 - 0,715
      12,03 - 1,064
      16,05 - 1,419
      20,05 - 1,775
      24,06V - 2,15 V

      My code

      #define MY_DEBUG                             // Enable debug prints to serial monitor
      #define MY_RADIO_RF24 // Enable and select radio type attached
      #define MY_NODE_ID 22
      
      #define voltagePin1 19 //A5 -- 1S
      #define voltagePin2 18
      #define voltagePin3 17
      #define voltagePin4 16
      #define voltagePin5 15
      #define voltagePin6 14 //A0 -- 6S
      #define RELAY1 5
      #define RELAY2 6
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 2
      
      #include <MySensors.h>
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      int voltSenseMax = 40150; // * Voltage divider R1 1 megaohm  R2 100 kilohms  -- 3.65V VCC
      int sampleCount = 0;  
      int sum = 0;              // sum of samples taken 
      int numSamples = 5;  
      int voltMilli;
      float voltage_array[6] = { 0, 0, 0, 0, 0, 0,};
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      DeviceAddress tempDeviceAddress;
      bool receivedConfig = false;
      bool metric = true;
      
      MyMessage msg_S_MULTIMETER(0, V_VOLTAGE);
      MyMessage msg(0,V_TEMP);
      
      void setup()
      {
        sensors.begin(); delay(10);
        
      for (int j=14; j<20; j++) {
       pinMode(j, INPUT);
        }
        
       pinMode(RELAY1, OUTPUT);
       digitalWrite(RELAY1, HIGH);
       pinMode(RELAY2, OUTPUT);
       digitalWrite(RELAY2, LOW);
      
      }
      
      void presentation()  
      {  
       sendSketchInfo("Solar Battery Monitor", "v05092020");    // Send the sketch version information to the gateway and Controller
      
        for (int j=14; j<20; j++) {
        present(j, S_MULTIMETER);
        }
        
        present(RELAY1, S_BINARY, "Cutoff Relay1");
        present(RELAY2, S_BINARY, "Cutoff Relay2");
        
        numSensors = sensors.getDeviceCount();
        Serial.print("Locating devices...");
        Serial.print("Found ");
        Serial.print(numSensors, DEC);
        Serial.println(" devices.");
        for (int i=0; i<numSensors; i++) {   
      
           present(i, S_TEMP);
        }
      }
      
      void loop()     
      {    
      // TEMPERATURES   
        sensors.requestTemperatures();
        for (int i=0; i<numSensors; i++) {
          if(sensors.getAddress(tempDeviceAddress, i)){
          Serial.print("Temperature for device: "); Serial.println(i,DEC);
          float tempC = sensors.getTempC(tempDeviceAddress);
          Serial.print("Temp C: ");
          Serial.println(tempC);
          send(msg.setSensor(i).set(tempC,1));
          }
        }
      
      // VOLTAGES
        for (int k=0; k<6; k++) {
          while (sampleCount < numSamples) {
              sum += analogRead(k+14);
              sampleCount++;
              delay(5);
              }
         
        int voltMilli = -(map((sum / numSamples),0,1023,0,voltSenseMax))*1.5988;  // map the reading and get the result in millivolts
        send(msg_S_MULTIMETER.setSensor(k+14).set((voltMilli / 1000.0), 2));   // Divide by 1000 to convert back to volts to two decimal places, send data to controller.                                                                                                                                            // send voltage message to gateway with 1 decimal place
        Serial.print(voltMilli / 1000.0);
        Serial.println(" V");
      //  float voltage_array[k] = (voltMilli / 1000);
        sampleCount = 0;
        sum = 0;
        delay(5000);
        }
      
      delay(15000);
      
      } 
      
      void receive(const MyMessage &message)
      {
        if (message.type==V_STATUS) {
          digitalWrite(message.sensor, message.getBool());
          saveState(message.sensor, message.getBool());
          Serial.print("Incoming change for sensor:"); Serial.print(message.sensor);
          Serial.print(", New status: "); Serial.println(message.getBool());
        }
      }
      

      I would also like to get the voltages as values to play with in the code (to monitor high and low voltages) but I cant make "voltage_array" work. Can someone with more arduino-code powers help here?

      1. why do the voltages read wrong? Why do the values come out negative (see the "-" in the voltMilli calculation)?
      2. why do the ds18b20's not show up?
      3. how do I get the values from the for-loop to play with? The "float voltage_array[k] = (voltMilli / 1000)" causes errors
      posted in Troubleshooting
      MasMat
      MasMat
    • RE: Sensor for Vallox DigitSE RS485 ventilation system with integration into FHEM.

      I found this old thread and since I have a Vallox machine it's interesting. RS485 is new to me but MySensors isn't.

      Can I have a node like this described by Heinz parallel with the "mickey mouse"-display? Using the display's connector? Or is it one or the other?

      I'd feel better having both (manual display&buttons and connection to MySensors=>Domoticz, in my case).

      posted in My Project
      MasMat
      MasMat
    • RE: 💬 Building a Raspberry Pi Gateway

      @ej3-martin My LEDs come on when the Rpi boots (is that what you mean by testing?). Also you can invert the LEDs (on but blink off) if you want. I figured the wiring makes for better power delivery rather than feeding voltage from the GPIO

      posted in Announcements
      MasMat
      MasMat