Code Monkey home page Code Monkey logo

Comments (7)

computourist avatar computourist commented on July 16, 2024

Hi David,

Sorry for the delay in replying; I have been abroad for some time.

It is hard for me to debug your gateway. You would have to indicate exactly
how you put together the hardware and how you implemented your MQTT broker.
Is your gateway faulty or are the end nodes failing ? Is the link with the
broker down or not ?

My experience is these problems in most cases are power supply related.
Make sure your power supply delivers enough current and your 3.3 Volts
supply for the RFM module can deliver the current needed in high-power
mode. Decoupling of the power supply is needed.

Good luck !

Computourist

2015-04-29 23:33 GMT+02:00 David Hrbaty [email protected]:

Hello computourist,
I'm trying your code of Gateway, but I have big strange with freezing
after several minutes. When I turned off debug, it was better to take
uptime several minutes. Can you advise me, where can be a problem? I
downloaded the newest version RFM libraries, but problem still persist.

Thank you


Reply to this email directly or view it on GitHub
#5.

from rfm69-mqtt-client.

 avatar commented on July 16, 2024

Hi computourist,

Thank you for your response. I know, that it is hard to debug my gateway. So I include my schematic, because I have used arduino with 5V, so I must use 74HC4050 between arduino board and rfm69hw board. There is schematic:

https://lh4.googleusercontent.com/-vKxMicnYmfQ/VVJO1UJzJ6I/AAAAAAAAEOE/YZsUyeWj1cg/w958-h552-no/rfm69_schematic.png

After main change in your code, especially with mqttclient loop:

long watchdogInterval = 2000;


if (millis() > watchdog) {
    watchdog += watchdogInterval;
    if (!mqttClient.connected() && !connect_mqtt()) {
      return;
    }
    noInterrupts();
    mqttClient.loop();
    interrupts();
}
}   // end loop

boolean connect_mqtt() {
   mqttCon = 0;
   digitalWrite(MQCON, LOW);
  if (mqttClient.connect(clientName)) {
      mqttCon = 1;              // Yes, we have a link so,
      digitalWrite(MQCON, mqttCon); // turn on MQTT link indicator and
      mqttClient.subscribe(subTopic);   // re-subscribe to mqtt topic
    return true;
  }
  return false;
}

I got uptime for several days. After four days of operation I got freeze of gateway. My wireless nodes are up, but have no connection. After restart gateway, wireless nodes have connection again.

When gateway is in freeze mode, it does not respond to any mqtt message.
MQTT broker (mymousquito) is on the same subnet that wireless gateway.

Thank you for your time.

from rfm69-mqtt-client.

computourist avatar computourist commented on July 16, 2024

Hello David,

have you changed the interrupt handling in file W5100.h before compiling, as indicated in the header of the sketch ?

Rgds,

from rfm69-mqtt-client.

 avatar commented on July 16, 2024

Hi computourist,

Do you mean changes in w5100.h ? Especially this section:

#else
inline static void initSS() { DDRB |= _BV(2); };
inline static void setSS() { cli(); PORTB &= ~_BV(2); };
inline static void resetSS() { PORTB |= _BV(2); sei(); };
#endif

Because I forgot to change it. I think, that there will be whole problem. I'll try it when I 'll be at home during weekend.

I'll write here the result. Thank you again for your advice.

from rfm69-mqtt-client.

computourist avatar computourist commented on July 16, 2024

Without these changes in W5100.h the RFM69 tries to seize the SPI bus at the same time as ethernet.

from rfm69-mqtt-client.

Gizzbert avatar Gizzbert commented on July 16, 2024

ah, thanks, this helped, I also overlooked it, might be helpful to add the following to the sketch of the gateway:
// change %program files%\arduino\libraries\Ethernet\src\utility\w5100.h:
// #else
// inline static void initSS() { DDRB |= _BV(2); };
// inline static void setSS() { cli(); PORTB &= ~_BV(2); };
// inline static void resetSS() { PORTB |= _BV(2); sei(); };
// #endif

thanks, gateway works like a charm now :)

from rfm69-mqtt-client.

computourist avatar computourist commented on July 16, 2024

Good to hear you got it all working now. Have fun !

from rfm69-mqtt-client.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.