-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RAK4631 Ethernet Gateway with working JSON output to MQTT #4661
Conversation
Fix default build environment
Great work, do you have an insight how much bigger this makes the firmware? We didn't use ArduinoJson at the time we introduced support since it's a massive lib... Also - if Json is not supported on nRF with the current lib, why make this an additional variant? can't we just add this to the regular 4631 target? |
Hi @caveman99 I made it a separate variant as I am thinking that we (RAKwireless) might offer an nRF52 based Meshtastic Gateway with Ethernet. For the code size I compiled from the latest firmware repo:
When building for gateway function with WiFi, PKI and Power FSM disabled:
So not much difference. I think I can lower it by changing the MQTT::onReceive() function to use ArduinoJson as well. Then I can compile without For the tested message types, I set up an node with detection and |
Not sure about the name for the variant. |
compelling argument, i'd go with rak4631_eth_gateway for the variant name. Wanna hear what @thebentern thinks. Just one thought: PKI is required for remote admin; even if the gateway is ETH connected it might be aprt of a bigger centrally managed network. I'd leave this in if possible. |
Agreed (after some digging what it is used for).
Any of these are required for a proper working stationary Ethernet gateway. |
I usually prefer short names, like |
Looks good. In case this product will get a RAK designator, we can also go with this label instead. We've been doing it for the field tester ... |
You can test the A downside of using another library here is that, since the JSON output needs to be added manually every time, now it needs to be done (and tested) in two places with slightly different API. |
I will give it a try. |
@GUVWAF |
Tested |
@beegee-tokyo Thoughts on excluding SCREEN as well, the SCREEN lib can take up a decent space from my testing when i was working in a different fork for a different reason. Expectation of a RAK MQTT Gateway needing a screen? I think time functions should remain remain (Assuming that's what TZ is?), as with ETH we have the ability to poll a NTP server to provide valid time to the mesh. |
Good idea for the SCREEN. But I had to change two more modules because they were just using the OLED without checking if it is enabled. That lead to compilation errors. (Sorry for my crappy double #ifdef's). With disable SCREEN and enabled TZ the code size goes down to 84%:
Continue testing now. No crashes so far. |
Preview of the device: USB is only connected for flashing and debug. Device is powered through the PoE: |
I'll happily do some testing on this if this is still sitting open over the weekend, I have one or both of the modules (ethernet or the POE, don't recall, need to check) |
@Talie5in |
Someone please help with the code formatting. |
@beegee-tokyo I ran Since this is isolated in its own variant, in general I’m fine with this, but I don’t think you can expect the JSON part to be maintained as it requires manual changes using a different API and can only be tested with specific hardware. |
Formatting for PR #4661
What is missing to merge this? |
@GUVWAF |
If you are developing on windows, trunk does not contain all the linters we use. notably cppcheck is missing. I always do the trunk check in WSL. Let me resolve the conflict now and get this merged in. |
Added new variant RAK4631 with MQTT JSON enabled to be able to build a MQTT JSON gateway using Ethernet with the RAK4631.
JSON on nRF52 works when using ArduinoJson library.
Fixes #2804
Makes #3286 unnecessary
Tested messages:
Untested messages (do not know how to generate them or do not have the hardware):