Navigation

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

    Mouridsen

    @Mouridsen

    2
    Reputation
    11
    Posts
    754
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Mouridsen Follow

    Best posts made by Mouridsen

    • RE: Servo issues - Weird things happening!!

      Just to let you know that I solved the issue.
      I found a library where you can control the speed and make sure it get to it's position.
      You can find it here: https://github.com/netlabtoolkit/VarSpeedServo
      I incorporated it in the Mysensor sketch and it works eventhoug it looks like it only goes like 90 degrees but it's enough for me :

      
      #include <MySensor.h>
      #include <SPI.h>
      #include <VarSpeedServo.h> 
      // #include <Servo.h> 
      
      #define SERVO_DIGITAL_OUT_PIN 3
      #define SERVO_MIN 0 // Fine tune your servos min. 0-180
      #define SERVO_MAX 180  // Fine tune your servos max. 0-180
      #define DETACH_DELAY 900 // Tune this to let your movement finish before detaching the servo
      #define CHILD_ID 10   // Id of the sensor child
      
      MySensor gw;
      MyMessage msg(CHILD_ID, V_DIMMER);
      VarSpeedServo myservo;  // create servo object to control a servo 
                              // a maximum of eight servo objects can be created 
      // Servo myservo;  // create servo object to control a servo 
                      // a maximum of eight servo objects can be created Sensor gw(9,10);
      unsigned long timeOfLastChange = 0;
      bool attachedServo = false;
                  
      void setup() 
      { 
        // Attach method for incoming messages
        gw.begin(incomingMessage);
      
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo("Servo", "1.0");
      
        // Register all sensors to gw (they will be created as child devices)
        gw.present(CHILD_ID, S_COVER);
      
        // Request last servo state at startup
        gw.request(CHILD_ID, V_DIMMER);
      } 
      
      void loop() 
      { 
        gw.process();
        if (attachedServo && millis() - timeOfLastChange > DETACH_DELAY) {
           myservo.detach();
           attachedServo = false;
        }
      } 
      
      void incomingMessage(const MyMessage &message) {
        myservo.attach(SERVO_DIGITAL_OUT_PIN);   
        attachedServo = true;
        if (message.type==V_DIMMER) { // This could be M_ACK_VARIABLE or M_SET_VARIABLE
           int val = message.getInt();
           myservo.write(SERVO_MAX + (SERVO_MIN-SERVO_MAX)/100 * val,255,true); // sets the servo position 0-180
           // Write some debug info
           Serial.print("Servo changed. new state: ");
           Serial.println(val);
         } else if (message.type==V_UP) {
           Serial.println("Servo UP command");
           myservo.write(SERVO_MIN,255,true);
           gw.send(msg.set(100));
         } else if (message.type==V_DOWN) {
           Serial.println("Servo DOWN command");
           myservo.write(SERVO_MAX,255,true); 
           gw.send(msg.set(0));
         } else if (message.type==V_STOP) {
           Serial.println("Servo STOP command");
           myservo.detach();
           attachedServo = false;
      
         }
         timeOfLastChange = millis();
      }
      
      posted in Troubleshooting
      Mouridsen
      Mouridsen

    Latest posts made by Mouridsen

    • RE: Windows GUI/Controller for MySensors

      @tekka Thanks, it works perfect. That was a quite easy fix 🙂

      posted in Controllers
      Mouridsen
      Mouridsen
    • RE: req node id again

      @Daemon-D: Do you mean using the "Clear" button for the child nodes in Vera?? I have the same issue.

      posted in Troubleshooting
      Mouridsen
      Mouridsen
    • RE: Windows GUI/Controller for MySensors

      Well I found an old Windows laptop and it worked on that, so I guess it's the Mac computer 😥
      Yesterday I tried to make a Repeater with the standard sketch as instructed. Now I can see that it says: Undefined firmware/type. What is the reason for that???

      30-03-2015 15:03:38 NODE: New node discovered, node id=34
      30-03-2015 15:03:38 CHILD: New child discovered, node id=34, child id=internal
      30-03-2015 15:03:38 DEBUG: Update child id=255, type=ARDUINO_RELAY
      30-03-2015 15:03:38 RECV: 0;0;3;0;9;read: 34-34-0 s=255,c=3,t=6,pt=1,l=1:0
      30-03-2015 15:03:38 RECV: 34;255;3;0;6;0
      30-03-2015 15:03:38 SEND: 34;255;3;0;6;M
      30-03-2015 15:03:38 RECV: 0;0;3;0;9;send: 0-0-34-34 s=255,c=3,t=6,pt=0,l=1,st=ok:M
      30-03-2015 15:03:40 RECV: 0;0;3;0;9;read: 34-34-0 s=255,c=3,t=11,pt=0,l=13:Repeater Node
      30-03-2015 15:03:40 RECV: 34;255;3;0;11;Repeater Node
      30-03-2015 15:03:40 DEBUG: Undefined firmware/type for node=34
      30-03-2015 15:03:40 RECV: 0;0;3;0;9;read: 34-34-0 s=255,c=3,t=12,pt=0,l=3:1.0
      30-03-2015 15:03:40 RECV: 34;255;3;0;12;1.0
      30-03-2015 15:03:40 DEBUG: Undefined firmware/type for node=34

      I think it works because when I disconnect it stops sending messages to MYSController so all communication to this is done via the repeater.
      Is it something to worry about???

      posted in Controllers
      Mouridsen
      Mouridsen
    • RE: Windows GUI/Controller for MySensors

      Hi guys! I'm still a newbie but i'm very interested in this tool and I'm quite confused how to install it. I'm only interested in see the communication to start with.

      Is there an installation instruction somewhere?

      I have tried to install it but I can't see any serial ports in the config window. Here is what I have done:

      1. Downloaded the package and run the program (I'm using Wine on a Mac)
      2. Uploaded a the standard SerialGateway sketch from Mysensor to a Nano board and have it connected to the computer. I can see from the serial monitor in the Arduino IDE that it sees the communication fine from the various sensors.
        I haven't done anything to the Gateway that's connected to the Vera. Is it that one I should use and connect to the computer???

      Sorry for the newbie questions..

      posted in Controllers
      Mouridsen
      Mouridsen
    • RE: Servo issues - Weird things happening!!

      Just to let you know that I solved the issue.
      I found a library where you can control the speed and make sure it get to it's position.
      You can find it here: https://github.com/netlabtoolkit/VarSpeedServo
      I incorporated it in the Mysensor sketch and it works eventhoug it looks like it only goes like 90 degrees but it's enough for me :

      
      #include <MySensor.h>
      #include <SPI.h>
      #include <VarSpeedServo.h> 
      // #include <Servo.h> 
      
      #define SERVO_DIGITAL_OUT_PIN 3
      #define SERVO_MIN 0 // Fine tune your servos min. 0-180
      #define SERVO_MAX 180  // Fine tune your servos max. 0-180
      #define DETACH_DELAY 900 // Tune this to let your movement finish before detaching the servo
      #define CHILD_ID 10   // Id of the sensor child
      
      MySensor gw;
      MyMessage msg(CHILD_ID, V_DIMMER);
      VarSpeedServo myservo;  // create servo object to control a servo 
                              // a maximum of eight servo objects can be created 
      // Servo myservo;  // create servo object to control a servo 
                      // a maximum of eight servo objects can be created Sensor gw(9,10);
      unsigned long timeOfLastChange = 0;
      bool attachedServo = false;
                  
      void setup() 
      { 
        // Attach method for incoming messages
        gw.begin(incomingMessage);
      
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo("Servo", "1.0");
      
        // Register all sensors to gw (they will be created as child devices)
        gw.present(CHILD_ID, S_COVER);
      
        // Request last servo state at startup
        gw.request(CHILD_ID, V_DIMMER);
      } 
      
      void loop() 
      { 
        gw.process();
        if (attachedServo && millis() - timeOfLastChange > DETACH_DELAY) {
           myservo.detach();
           attachedServo = false;
        }
      } 
      
      void incomingMessage(const MyMessage &message) {
        myservo.attach(SERVO_DIGITAL_OUT_PIN);   
        attachedServo = true;
        if (message.type==V_DIMMER) { // This could be M_ACK_VARIABLE or M_SET_VARIABLE
           int val = message.getInt();
           myservo.write(SERVO_MAX + (SERVO_MIN-SERVO_MAX)/100 * val,255,true); // sets the servo position 0-180
           // Write some debug info
           Serial.print("Servo changed. new state: ");
           Serial.println(val);
         } else if (message.type==V_UP) {
           Serial.println("Servo UP command");
           myservo.write(SERVO_MIN,255,true);
           gw.send(msg.set(100));
         } else if (message.type==V_DOWN) {
           Serial.println("Servo DOWN command");
           myservo.write(SERVO_MAX,255,true); 
           gw.send(msg.set(0));
         } else if (message.type==V_STOP) {
           Serial.println("Servo STOP command");
           myservo.detach();
           attachedServo = false;
      
         }
         timeOfLastChange = millis();
      }
      
      posted in Troubleshooting
      Mouridsen
      Mouridsen
    • RE: Servo issues - Weird things happening!!

      @slarti Sorry for my late answer! I did try your sketch but it's still the same. I really don't know what the issue can be. I have considered to try buying the motor that's on the mysensors page instead. I don't know what the difference is between the two. Any ideas what I could try with the current motors???

      posted in Troubleshooting
      Mouridsen
      Mouridsen
    • Servo issues - Weird things happening!!

      Hi guys,

      I tried to connect a servo to a Uno board and uploaded the standard sketch ServoActuator.
      It really does some weird things. It's almost like it runs too long to one side. And if I try to e.g. push "open" twice it runs in the other direction instead of to the same side again.
      I have tried to modify the max & min values but it still does the weird things.
      The communication to the gateway is fine and the values from the Vera are received with the correct values.

      It's connected to a 5V adapter and grounded to the Arduino.

      I have uploaded a video to show what's happening:

      http://youtu.be/awpe0I8m-R8

      I have tried to connect the servo motor without the Mysensors sketch and used the Sweep sketch. To make it respond correctly I had to modify the delay value to around 5 in the line:
      delay(15); // waits for the servo to get there
      Otherwise it did something similar.

      Any suggestions?? Hope you can help!

      posted in Troubleshooting
      Mouridsen
      Mouridsen
    • RE: Problem with connecting several temperature sensors

      Hi again

      Problem solved!!! I found an other forum where some people had succes with a 2,2K ohm resistor instead of the 4,7k ohm and it worked. Now I get reading from 8 sensors.
      I still get the st=fail all the time but it does communicates the values to the Gateway and Vera Lite. Is it something I should try to fix or do it not make a huge different?

      Thanks for the input and the Christmas reading 🙂

      posted in Troubleshooting
      Mouridsen
      Mouridsen
    • RE: Problem with connecting several temperature sensors

      @ServiceXp I'm powering through the Arduino. I have tried to power the sensors with a 4,9V 450mA power supply and connected it to the sensors + and GND and to the Arduinos GND. It was the same result.
      I will try to measure the draw after christmas. Maybe the total length of the wires to the sensors get too long to supply the load needed or the resistance should be changed to a lower value?

      posted in Troubleshooting
      Mouridsen
      Mouridsen
    • RE: Problem with connecting several temperature sensors

      I have tried to make the diagram:
      Skærmbillede 2014-12-23 kl. 16.42.48.png

      I have tried to remove the resistor but no change.
      What size of capacitor do you think I should use?

      The gateway is around 10m away. Both the sensor and gateway have a 4,7uf capacitor mounted on the radio.

      I hope the diagram make sense 🙂

      posted in Troubleshooting
      Mouridsen
      Mouridsen