Navigation

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

    Marcell Kovacs

    @Marcell Kovacs

    3
    Reputation
    6
    Posts
    313
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Marcell Kovacs Follow

    Best posts made by Marcell Kovacs

    • RE: st=fail help please

      Hey all,
      I started to build an advanced sensor node after playing around the samples. Messed up sometimes, which took me few hours to figure out. So here are some basic things to check (probably for noobs like me):

      • This is NOT a 5V device, connect to 3.3V 🙂
      • Call "gw.process()" often! Without it a few messages might be still sent, but ack will surely fail.
      • Do NOT sleep. use gw.wait() (same when you do long operations on another device, like waiting for Serial events)
      • double-triple check if you use the same MyConfig.h for your sensors (forgot to flash with the new one)
      • take care when using interrupts. No Serial in ISR! 🙂
        +1: when you 'present' some sensors with ack, gw.wait() a bit between them for a better success rate.
        Hope you won't have these kind of issues.

      // If you this this post should not be here, please rage 😉

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs
    • RE: Migrating to MySensors 2.0

      @hek said:

      You might need to declare them extern so the compiler won't complain.

      This IS the solution. Thank you for this. To be honest i never used (or knew) extern keyword exists. As a Java-dev, i see this against I believe in : )

      Thank you! You made me see the light in the tunnel. (I'm still in the hope its not the train : )

      To share the actual solution:
      In the class, where I was using MyGateway *gw before, now I have this (in the .cpp file):
      extern bool send(MyMessage &message, bool enableAck)
      ...and i replaced gw->send(..) with send(..)

      The imports for the MyMessage class had to be changed to core/MyMessage.h.
      I'm using visual micro + visual studio for this development.

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs

    Latest posts made by Marcell Kovacs

    • Implementing controller for Serial Gateway

      Hi,
      I started to develop a simple controller in Java, implementing node ID assignment and the most basic stuff to let mysensors work. The sensor data is then mirrored to MQTT, similar to the way Openhab 1.6 tutorial shows.

      With MySensors 1.6 and 2.0, I had about the same problem: flow control between controller and gateway.

      Now I have a system having 3 threads:

      • sending
      • receiving
      • listening for ACK packets, resending messages after a timeout

      I have 16 relays controlling my lights in my home. If I send a command to each of them too fast, some messages gets lost. (I'm connecting over USB-serial, reproduced on Windows 10 and Raspberry Pi).

      It actually turned out, if I wait about 350 milliseconds after sending a command, the system gets pretty stable. But... slow as well.
      Can you please advice on how to properly implement flow control on a serial gateway? I know this should have a simple solution and I must be doing something wrong : )

      About buffering from Java side, I'm flushing my output stream be deterministic when waiting for that 350 ms.

      posted in Development
      Marcell Kovacs
      Marcell Kovacs
    • RE: Migrating to MySensors 2.0

      @hek said:

      You might need to declare them extern so the compiler won't complain.

      This IS the solution. Thank you for this. To be honest i never used (or knew) extern keyword exists. As a Java-dev, i see this against I believe in : )

      Thank you! You made me see the light in the tunnel. (I'm still in the hope its not the train : )

      To share the actual solution:
      In the class, where I was using MyGateway *gw before, now I have this (in the .cpp file):
      extern bool send(MyMessage &message, bool enableAck)
      ...and i replaced gw->send(..) with send(..)

      The imports for the MyMessage class had to be changed to core/MyMessage.h.
      I'm using visual micro + visual studio for this development.

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs
    • Migrating to MySensors 2.0

      Dear MySensors Devs,

      I already have a basic home automation setup with MySensors 1.5-6. Now I decided to give a try and update my nodes to run MySensors 2.0, but Im facing challenges i cant overcome at the moment.
      More or less its related to my low experience with C++ and Arduino build. I hope this will be easy for you.

      The main problem is, i implemented some classes to separate responsibilities. Few of them are depending on MyMessage and one depends on MyGateway. Since 2.0 these classes seems to be not available for inclusion from the .ino and other .h/.cpp files.

      Is there any workaround for this? (basically i have no reference to MySensor's gateway object, none of them can be included)
      Another way will be to hide all MySensors functionality behind an interface, implemented in the main .ino file, passing calls to mySensors. I'm about to make this change to make the MySensors dependency somewhat weaker, but would be nice to refactor this after i have a working state.

      One of my classes in the example: RadioMirror's constructor:
      RadioMirror(MySensor *gw, OutputState state, byte outputCount, const byte radioIds);
      , where i cant pass a gw object anymore, because its hidden somewhere (or include MyMessage.h anymore).

      Thank you in advance, You created an awesome library anyway 🙂
      BR,
      marcell

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs
    • RE: st:fail sometimes and sometimes OK

      @rvendrame said:

      Once I had similar problems, a 4.7nF cap and gw.wait(100) after each transmit did the trick for me... Hope it helps somehow.

      I also got to this solution when experienced the same 'st:fail' issue. The arduino's delay wont help, because it wont receive anything from radio during the delay.

      As i got mutch less or no error with ack = false, I thing its linked to receiving some ACK packets. I have no deeper information or debugging possibilities at the moment.

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs
    • RE: Problems with ENC28J60 losing connection/freezing (using UIPEthernet or etherShield)? READ THIS!

      Thank you for this post! Saved the day!
      Just for information, im using EtherShield, with this lib: https://github.com/jonoxer/etherShield/blob/master/enc28j60.c
      (it has ugly limitations, but has the smallest memory requirement in my case)

      The solution fits almost exactly, with some small modifications (around line 290):

      
         if( (enc28j60Read(EIR) & EIR_TXERIF) )
               {
                  enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRST);
                  enc28j60WriteOp(ENC28J60_BIT_FIELD_CLR, ECON1, ECON1_TXRST);
                  enc28j60WriteOp(ENC28J60_BIT_FIELD_CLR, EIR, EIR_TXERIF); // Might be overkill but advised by Microchip Errata point 12, //MagKas 2014-10-25
               }
      

      Thanks again!

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs
    • RE: st=fail help please

      Hey all,
      I started to build an advanced sensor node after playing around the samples. Messed up sometimes, which took me few hours to figure out. So here are some basic things to check (probably for noobs like me):

      • This is NOT a 5V device, connect to 3.3V 🙂
      • Call "gw.process()" often! Without it a few messages might be still sent, but ack will surely fail.
      • Do NOT sleep. use gw.wait() (same when you do long operations on another device, like waiting for Serial events)
      • double-triple check if you use the same MyConfig.h for your sensors (forgot to flash with the new one)
      • take care when using interrupts. No Serial in ISR! 🙂
        +1: when you 'present' some sensors with ack, gw.wait() a bit between them for a better success rate.
        Hope you won't have these kind of issues.

      // If you this this post should not be here, please rage 😉

      posted in Troubleshooting
      Marcell Kovacs
      Marcell Kovacs