Navigation

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

    Posts made by nielsokker

    • RE: Show Real-time IMU data from four nodes

      Ah, thank you for your response! I am gonna take a look at it.

      I made pymys work for version 2.0, just some minor adjustments. I made it work with flask and socket.io, (will post some code and links later, dont have much time now). It display exactly what i want on a webpage and it is pretty real-time.

      The only problem i am facing is that it will not automatically start at boot. I tried every possible solution as far as i know, but i just cant get it running properly. It will start, but will get the error that the bytes are not right(startbyte not right, continuation byte not right). It is so weird that when i start it by hand, it will do fine.

      Does someone have a solution? in the meantime i will try the controller mentioned above.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Show Real-time IMU data from four nodes

      I will!

      Restored my RPI today. I am going to use pyMYS. Only need something to display it.

      Will keep you guys informed!

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Show Real-time IMU data from four nodes

      Hmm, after looking at it. It seems a big "overkill" for my intentions. What do you guys think about pyMYS. Maybe that will do the job?

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Show Real-time IMU data from four nodes

      @Yveaux and @TheoL,

      Thanks for your help,

      I am going to use this. Exactly what i need!

      posted in Troubleshooting
      nielsokker
      nielsokker
    • Show Real-time IMU data from four nodes

      Hey guys,

      After successfully using domoticz and MySensors to automate my house, i have a new project.

      I want to show data from four nodes on a controller. All four nodes only have an IMU. I got all of the nodes working and they are sending data (pitch and roll) with 4hz. I want to display this data real-time. Currently i tried domoticz but it doesnt refresh enough and i cant get a right datatype.

      Does anyone know a controller that fits my project, or maybe another approach?

      Looking forward to your answers!

      Thanks in advance, Niels

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: How do I turn a Pin to HIGH from controller?

      There is an example that exactly gives you what you need. The Relay example is the structure of what you need to use.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: What is wrong with this sketch?

      @Cliff-Karlsson said:

      I tried again with your sketch @nielsokker , I think I only added some sleep. But the motion-sensor just turns on/off super-quick every time the motion triggers. What am I doing wrong ?

      Yea, my example just checks both sensors every second. So it sends both values every second. I know now that is not what you want. At least the code looks better in my opinion (ofc its my code πŸ™‚ ).

      I have to agree with @AWI that it seems like your sensor does not work properly.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: What is wrong with this sketch?

      @Cliff-Karlsson

      I see why. But once again, i think i made your sketch work.

      As i see it. This is the current desired logic.

      once per second, you want to check the following things:

      • is there motion?
      • has there been a change in pressure (HIGH to LOW or LOW to HIGH)?

      But actually you want to check both ALWAYS. The thing you are obviously looking for, are interrupts. I do not know how these work if you do not want to sleep. Maybe there is a wait(interrupt_pin_1_functor, interrupt_pin_2_functor, waittime=forever) function (I know the sleep() version exists).

      Maybe you already know what interrupts are but, in short: When a given interrupt pin notices a difference in value (HIGH to LOW, for example) it gives a signal. The current code is being stopped and the function that is bound to the pin is executed. This function could be sending the new value to the gateway.

      Can someone confirm this?

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: What is wrong with this sketch?

      @Cliff-Karlsson

      I dont really understand what you mean. You want it to send its value every second? In that case my attempt still works. You want to use interrupts?

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: What is wrong with this sketch?

      @nielsokker

      I see it does not compile. You have to change the define.

      
      #define FSR_Pin = A0; //analog pin 0 needs to be
      

      needs to be

      
      #define FSR_Pin  A0 //analog pin 0 needs to be
      
      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: What is wrong with this sketch?
      #define MY_DEBUG    // Enables debug messages in the serial log
      #define MY_RADIO_RFM69
      
      #include <SPI.h>
      #include <MySensors.h>
      
      #define MY_REPEATER_FEATURE  // Enables repeater functionality for a radio node
      
      
      #define PRESSURE_ID 1
      #define MOTION_ID 2   // Id of the sensor child
      
      
      unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define FSR_Pin = A0; //analog pin 0
      
      int value = 0; // change this to a signed  or unsigned thingy
      int oldvalue = 0; // change this to a signed  or unsigned thingy
      
      #define OPEN 0
      #define CLOSE 1
      
      boolean lastTripped = 0;
      MyMessage msgPressure(PRESSURE_ID, V_TRIPPED);
      MyMessage msgMotion(MOTION_ID, V_TRIPPED);
      
      void setup()
      {
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as inputa
      }
      
      void presentation()
      {
        sendSketchInfo("Pressure/Motion Sensor", "1.0");
        present(PRESSURE_ID, S_DOOR);
        present(MOTION_ID, S_MOTION);
      }
      
      void loop()
      {
        int FSRReading = analogRead(FSR_Pin);
        if (FSRReading > 150)
        {
          value = CLOSE;
        }
        else
        {
          value = OPEN;
        }
        // Read digital motion value
        boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR);
      
        if (lastTripped != tripped) // if only the tripped has changed
        {
          //Serial.println(tripped);
          send(msgMotion.set(tripped ? "1" : "0")); // Send tripped value to gw
          lastTripped = tripped;
        }
        if (value != oldvalue)
        {
          send(msgPressure.set(value ? "1" : "0"));
          oldvalue = value;
        }
        wait(SLEEP_TIME);
      }
      

      I changed the loop part. I had a lot of double code which did not do anything. I changed some ints to defines because they did not change ever. I changed sleep to wait since it is a repeater (they cannot sleep). Also. After every round you want to sleep, so why not just write it once instead of in every if statement.

      I hope this helps you.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: What is wrong with this sketch?

      I am trying to debug it. I will let you know in a second.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Mqtt-client-gateway / nodes do not get an id

      Oh sorry I see it now. In that case good luck πŸ˜‰

      I am going to take a look at the API to see if something is there.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Problems with first sensors

      @blebbens

      The old define, might become useless, but it wont be in the way either. It is your choice.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Mqtt-client-gateway / nodes do not get an id

      @Thomas-Augustinus

      I'm not 100 percent sure, but i think that the controller tells the nodes what id they have. Right now you do not have this. To solve this: set a static ID (see 2.0 API) or attach a controller.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Problems with first sensors

      @Tore-AndrΓ©-Rosander said:

      define child id"

      I think so too.

      These are probably just minor mistakes, changing from MySensors versions.

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Problems with first sensors

      @SGi

      I am not an expert but i had the same problem. I think a controller determines the id. But since you have none, it can't be done this way. Set a static ID with

      #define MY_NODE_ID 11 
      

      or something

      posted in Troubleshooting
      nielsokker
      nielsokker
    • RE: Programming

      I can only give you my personal advice.

      Since you're on this forum, I expect that you are interested in sensors and stuff. In that case. Download this library and look at the examples. Try to understand them and try to adjust them slightly.

      But, maybe it is a better idea to google "c++ tutorial". Arduino is C++ based. And this will definitely teach you the basics of the language.

      Last, try to look at the Arduino website.

      posted in General Discussion
      nielsokker
      nielsokker
    • RE: Converting a sketch from 1.5.x to 2.0.x

      @pascalgauthier

      I'm not sure. I think the developers will know.

      posted in Announcements
      nielsokker
      nielsokker
    • RE: Converting a sketch from 1.5.x to 2.0.x

      @pascalgauthier

      I think the function "wait()" might be useful. It is like a sleep, but now it calls "process()"

      posted in Announcements
      nielsokker
      nielsokker
    • Little mistake in the 2.0 API

      the chapter "Create Repeating Nodes:" says that,if you want a node to be a repeater, you have to define

      #define MY_REPEATER_NODE
      

      this should be:

      #define MY_REPEATER_FEATURE
      

      I noticed it when i was making a repeating dth11 sensor node.

      Hope it helps πŸ‘

      posted in Bug Reports
      nielsokker
      nielsokker
    • RE: MySensors 2.0.0 Released

      @Lars65

      I had the same error. You have to(instead of what the 1.5 manual says) keep all the files in the mysensors_master folder. This folder needs to be in the libraries folder that already exists.

      posted in Announcements
      nielsokker
      nielsokker
    • RE: MySensors 2.0.0 Released

      @tekka

      Thank you for your answer! Does this mean that the hardware is failing? I used the repeater example.

      posted in Announcements
      nielsokker
      nielsokker
    • RE: MySensors 2.0.0 Released

      I've just tried it and it look really great!

      When is the documentation comming? I'm having some trouble understanding the errors i get in the log. It says: !TSM:CHKID:FAIL (ID=255)
      !TSM:FAILURE
      TSM:PDT

      Anyone has an idea?

      Thanks in advance!

      posted in Announcements
      nielsokker
      nielsokker