-
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 RAKwireless WisMesh Hub (RAK2560/RAK9154) #4117
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, this is a very useful device in the line-up cause we have many requests for ready-made devices. Please see my review comments, hoping i judged the intent of the changes correctly.
.vscode/extensions.json
Outdated
], | ||
"unwantedRecommendations": [ | ||
"ms-vscode.cpptools-extension-pack" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't check in the vscode files. This will cause merge conflicts all over the place.
@@ -0,0 +1,191 @@ | |||
#ifdef HAS_RAKPROT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the RAK9154 support is places correctly. The Telemetry folder is for devices that actually transmit values over Lora. This looks more like gathering values for internal processing. If this is only ever used once for this particular device, you can as well put it in the variant folder and skip deriving it from TelemetryModule. If you add the OSThread class to inheritance you can use the runOnce model without having to define it as a sensor (which it isn't in the meshtastic sense)
|
||
bool RAK9154Sensor::getMetrics(meshtastic_Telemetry *measurement) | ||
{ | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively if the values really should be able to go out over the mesh, you need to implementthese functions :-)
variants/rak4631/variant.h
Outdated
// #define PIN_GPS_EN PIN_3V3_EN | ||
// Disable GPS | ||
#define MESHTASTIC_EXCLUDE_GPS 1 | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not only disable GPS but removes all GPS code from the binary. I assume goal is to have a GPS active on Serial2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caveman99 Just thinking out loud, should this go into its own variant/rak2560/ - otherwise some code gets clobbered (eg, the JLink CDC pin assignment, unsure if that's used but noticed it while going through the changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Talie5in
I can create extra variant files for RAK2560, but I wanted to avoid double maintenance, RAK2560 is just a RAK4631 on a different PCB with a solar power battery. With both in one variant.h I have to work only with one file if there are changes required.
Open for suggestions @caveman99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really depends on how much it diverges from a stock 4631+Baseboard. Right now there's only a handful of defines. In the long term i think i'd prefer a separate variant.h file, since this is more or less a fixed configuration while we have to account for all sorts of modules on the wisblock boards. We broke out an EINK version too, since the defines were diverging too much and it got harder and harder to keep them apart.
also worth noting: We do have an ENUM for devices to identify who is actually talking to us. Right now this code is masquerading as a RAK4631. I'd really like to assign this its own RAK2560 label or even better call it WISMESH-HUB. If you agree i'd open up a pull request to the devicenum protobuf. |
Hi @caveman99 (1) "Please don't check in the vscode files" (2) " if the values really should be able to go out " (3) "I assume goal is to have a GPS active on Serial2?" (4) "I'd really like to assign this its own RAK2560 label" I will work on the changes and push again. |
Another request: can you enable 'maintainer edits' on the pull requests? our repo is set up so we cant' merge outdated pull requests, and we need to be able to update your fork with other changes (rebase). |
The RAK2560 HW_MODEL protobufs should be available downstream now. @caveman99 this would just need to be pretty much a carbon copy of the RAK4631 but with the variant.h changes and the additional macro? |
@thebentern |
I believe all you should need is to pull over what you have for the RAK4631 variant.h, since they're identical except for the serial port changes and additional macros. |
variants/rak2560/platformio.ini
Outdated
;upload_protocol = jlink | ||
extra_scripts = | ||
${env.extra_scripts} | ||
../firmware/variants/rak2560/create_uf2.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can drop the ../firmware
part, this doesn't work if the local folder is named differently. variants/rak2560/create_uf2.py
should pick the script up just fine. The platfirmio.ini always assumes workspace root.
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard" | ||
-DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. | ||
-DHAS_RAKPROT=1 ; Define if RAk OneWireSerial is used (disables GPS) | ||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/rak2560> +<mesh/eth/> +<mesh/api/> +<mqtt/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/platform/nrf52/architecture.h needs to be amended to pick up the new hardware model, before the plain 4630 is found.
Also maybe slightly unrelated to this PR and needless to say, but if you plan to pre-flash them as Router/Repeater please make sure to not copy completely the same configuration to each device, because all devices will get the same unique NodeNum and that leads to issues on the mesh. |
Thanks a lot for the support to merge this in. @GUVWAF |
Last question Created a firmware from original sources for RAK2560. |
hi @beegee-tokyo I just happened to notice this bug and your comment. Yeah. Clients will eventually get the latest protobuf code and then properly convert the enum (which they don't recognize without those new strings) to the device name. (long time no see - I hope all is great for you -kevin). |
All good here, busy with RAKwireless WisBlock. And as RAKwireless is now jumping full speed on the Meshtastic train, I am on your trails now. No problem for now with the module name, it will take some weeks (I guess) before you can officially buy it. |
@beegee-tokyo cool beans. I've been away from meshtastic for a while but I've decided to devote some time to really decreasing power consumption. I'm initially using a RAK4630 that I had in a drawer as my reference platform for this work. It seems great! |
@geeksville |
RAKwireless is planning to offer the RAK2560 SensorHub and RAK9154 Solar Battery Lite preflashed with Meshtastic Firmware as a Meshtastic Router or Repeater under the name WisMesh Hub.
This pull request adds support for the RAK2560 device and the communication protocol for the RAK9154 Solar Battery Lite to Meshtastic.
The RAK2560 device is based on the RAK4630 (used on RAK4631) stamp module and is a low power device with LoRa and BLE connectivity.
The RAK9154 is a solar panel/battery combination with
WisMesh Hub in Meshtastic mobile app (temperature/humidity is optional and requires RAk1901 module inside the RAK2560):