Repository navigation
fix(variants): RAK3112 octal PSRAM, battery reading and Heltec pin leftovers (port of #14 to dmc-dev) - #15
Merged
Conversation
The RAK3112 (ESP32-S3R8) has 8MB octal PSRAM, but the variant used the esp32-s3-devkitc-1 default memory type (qio_qspi). Booting with BOARD_HAS_PSRAM then fails with "PSRAM ID read error ... wrong PSRAM line mode", so the variant ran without PSRAM and the observer envs needed MQTT_NEIGHBORS_WITHOUT_PSRAM to spend internal DRAM on the neighbors table. Set memory_type = qio_opi and BOARD_HAS_PSRAM; the neighbors table and TLS buffers now go to PSRAM and the opt-in flag is no longer needed. On dmc-dev only the [rak3112] base change applies; the observer envs and their MQTT_NEIGHBORS_WITHOUT_PSRAM hunks do not exist on this branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 417a112)
The RAK3112 variant was derived from Heltec V3 and kept two of its pin assignments that collide with the RAK3112's octal PSRAM (GPIO33-37): - PIN_ADC_CTRL (GPIO36) was driven as an output in begin(); the RAK3112 has no ADC enable pin. - ENV_PIN_SDA/SCL=33/34 started a second I2C bus on PSRAM data lines in the sensor and observer envs. External sensors on WisBlock slots sit on the main I2C bus (PIN_BOARD_SDA/SCL = 9/40). Also rename the sensor advert from "RAK3112 v3 Sensor" to "RAK3112 Sensor". On dmc-dev the observer-env hunks do not apply (no observer envs on this branch); the board header and the RAK_3112_sensor env changes are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 2e33e8e)
getBattMilliVolts() used the RAK4631 formula (raw * 3 * 1.73 * 1.187 / 4096), which assumes the nRF52's 3.0V ADC reference and does not apply to the ESP32-S3 ADC. Use the calibrated analogReadMilliVolts() and the WisBlock base board divider (1M/1.5M, empirical x1.73 as Meshtastic uses for the RAK4631 on the same base boards). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 12f0c97)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of the RAK3112 variant fixes from #14 by @hp197 to the
dmc-devbase, so the non-MQTT RAK3112 builds (repeater, room server, companions, sensor, bridges) get them too. #14 itself targetsdmc-observer-dev; upstream v1.18.0 still has the old setup.Problem
(Issues are disabled on this repo, so the rationale is here, per
AGENTS.md§6. Full analysis and hardware results are in #14.)The RAK3112 variant was derived from Heltec V3 and kept things that are wrong for the RAK3112 (ESP32-S3R8):
esp32-s3-devkitc-1board defaults to quad PSRAM (qio_qspi); the RAK3112 has 8 MB octal PSRAM.PIN_ADC_CTRL(GPIO36) was driven as an output inbegin(), and the sensor env started a second I2C bus on GPIO33/34.Changes (only
variants/rak3112/)The three commits from #14, cherry-picked with
-x, authorship kept (@hp197):fix(variants): enable octal PSRAM on RAK3112:board_build.arduino.memory_type = qio_opiandBOARD_HAS_PSRAM=1in[rak3112].fix(variants): drop Heltec V3 pin leftovers from RAK3112: removes thePIN_ADC_CTRLlogic andENV_PIN_SDA/SCL=33/34; sensor advert renamed "RAK3112 Sensor".fix(variants): correct RAK3112 battery voltage reading:analogReadMilliVolts()(eFuse-calibrated) × 1.73 for the WisBlock base board divider.Difference from #14: the
*_observer_mqtthunks (droppingMQTT_NEIGHBORS_WITHOUT_PSRAMandENV_PIN_*from the observer envs) are left out, because those envs do not exist ondmc-dev; that was the only conflict.RAK3112Board.his byte-identical to #14, and everyplatformio.inisection present on both branches matches.Verified
On this branch (Windows, PlatformIO):
pio runfor all 10RAK_3112_*envs: all build. repeater, repeater_bridge_rs232, repeater_bridge_espnow, room_server, terminal_chat, companion_radio_usb/ble/wifi, sensor, kiss_modem.pio test -e native: 179/179 passed.Not verified by me: no hardware flash of these
dmc-devbuilds. The PSRAM/MQTT behaviour was verified on hardware by @hp197 in #14 (observer room server: PSRAM found, 8 MB). The ×1.73 battery factor still lacks a multimeter check, as noted in #14.🤖 Generated with Claude Code