Send state of led

Hello, I would like to send the state of a led connect to switch from an ESP32 to a The Things Network application. Could someone please provide me with the necessary code for this?

Try LMIC-node on GitHub - you’ll need to read the instructions and read the Learn section on this site (menu at top right) - it’s all volunteers here so time is precious. If you need it doing for you, you’ll probably have to find a commercial engagement.

1 Like

Quite a few projects turn up in an internet search for ‘ttn node for esp32’ but the the volunteers in here dont maintain a repository of code examples for all the different micros.

It could be worth describing the project, whats its doing, how its powered etc, the ESP32 on its own might be reasonable as a TTN node, but some of the modules that are fitted with ESP32s might not be suitable.

1 Like

Thank you very much for your advice. I will try to use LMIC-node on GitHub as you suggested.

TTN does not operate a generic MQTT server that allows you to publish your own messages. It allows you to subscribe to MQTT to get messages transmitted by LoRaWAN devices and to publish to a very specific topic that results in a message being sent to the LoRaWAN device (at the appropriate time) and only to that device, not to subscribed mqtt listeners.

If you need a generic MQTT service you need to look elsewhere.

BTW, using an ESP-WROOM as a gateway won’t work as a gateway needs to be LoRaWAN specification compliant (using the right protocols) and the WROOM isn’t.

1 Like

The ESP-WROOM-32, on its own cannot work as a TTN or LoRaWAN gateway.

1 Like

Thank you for your explanation, I will try to search for another solution

There is no LoRa network - it seems you have chosen to use the TTN Community LoRaWAN Network.

How do you define ‘high’ - a TTIG is about twice the price of an ESP32 LoRa module but is a gateway and it “just works” and you won’t have to adapt the device code to work with it which requires a considerable level of expertise & knowledge AND we will continue to help you.

You’ve agreed amongst you’ll to disrupt a global network???

This is entry level stuff - Arduino 101 - not final year project material.

LMIC-node pretty much gift-wraps the solution to the project if you’ve learnt about LoRaWAN.

I think you have much larger problems than not being able to implement MQTT as an integration which is fully documented.

It would be interesting to know how you have ended up with this project - if need be your tutors can join the discussion on here to be appraised of the knowledge gap and the consequent inappropriate decisions being made.

TTN is not a playground, it is a community network, please do not attempt to connect anything less than a full gateway to it.

It seems strange that you are doing a LoRaWAN project at a teaching establishment that does not run one or more gateways that you can just use, just like the community does in TTN. Or at the least can lend you a gateway.

As for your concept of outgoing integrations, the Learn link at the top of this page as I have already mentioned will fill you in on LoRaWAN basics. LoRaWAN is a many layered topic, you can’t skip to the end of this book.

Going forward, as your first post was rather lacking in any obvious effort to perform any research, and as by policy we don’t do students homework, you’ll have to ask more focused questions evidenced with prior research.

This may sound harsh. It sort of is. We see students trying to take shortcuts often enough. However if you learn LoRaWAN properly, get certified, you have something on your CV that almost no other graduates will have when you apply for jobs.

1 Like