* * Adding the -Wcast-align compilation flag for
the rp2040.
* * Some rework to use a struct to access radio data
* Buffer will not be accessed by arithmetic pointer anymore
* * Remplace arithmetic pointer to avoid Warning
* * Avoid 2 little artitmetic pointer
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* When importing config, keep Bluetooth on and defer rebooting until config is committed
* One more place that was prematurely disabling Bluetooth
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Potential fix for bad Rx performance on T1000-E
* validate and refactor RF switching, eliminate godmode
---------
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
* Ignore PhoneAPI packet if it's been seen
* ignoramus
* Also keep track of the last 20 packet IDs
* Fill
* Make this match the nimble one
* Add the log too
* Ignore zero ID packets
* Remove message entirely
* TRunkt
* Replace multiple potentially non aligned pointer dereference (#4855)
First step to fix some Crypto crashes or strange behaviors
* Makes the two Crypto byte buffers aligned (#4855)
Fix#4855, and probably multiple Crypto problems depending on hardware
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: GUVWAF <78759985+GUVWAF@users.noreply.github.com>
There is no EXTINT pin available on the Tdeck, which uses
the Ublox M10 GPS. Therefore our previous hack to use that pin
makes the GPS not work. That workaround was implemented to
fix sleep issues which have now since been fixed with the
state machine.
This patch restores the state prior to the hack, which is
known-working.
Additionaly, it was discovered that M10s hate it when you
try and save to non-extistent eeprom/SPI flash.
This patch creates a new SAVE command for the M10 that fixes
this issue.
Many thanks to @MisterC925 whose report and testing was
essential for this fix.
fixes https://github.com/meshtastic/firmware/issues/4625
Co-authored-by: Ken McGuire <kenm@paonia.com>
Based on #4745, PIN_WIRE1_SDA is the 'second' wire interface.
This pach amends the check to determine whether a device has two
wire interfaces should use PIN_WIRE1_SDA, rather than PIN_WIRE_SDA.
* Rename message length headers and set payload max to 255
* Add MESHTASTIC_PKC_OVERHEAD
* compare to MESHTASTIC_HEADER_LENGTH
---------
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
* Refactor and consolidate windowing logic
* Trunk
* Fixes
* More
* Fix braces and remove unused now variables.
There was a brace in src/mesh/RadioLibInterface.cpp that was breaking
compile on some architectures.
Additionally, there were some brace errors in
src/modules/Telemetry/AirQualityTelemetry.cpp
src/modules/Telemetry/EnvironmentTelemetry.cpp
src/mesh/wifi/WiFiAPClient.cpp
Move throttle include in WifiAPClient.cpp to top.
Add Default.h to sleep.cpp
rest of files just remove unused now variables.
* Remove a couple more meows
---------
Co-authored-by: Tom Fifield <tom@tomfifield.net>
* Minor fixes
It turns out setting a map value with the index notation causes
an lookup that can be avoided with emplace. Apply this to one line in
the StoreForward module.
Fix also Cppcheck-determined highly minor performance increase by
passing gpiochipname as a const reference :)
The amount of cycles used on this laptop while learning about these
callouts from cppcheck is unlikely to ever be more than the cycles
saved by the fixes ;)
* Update PortduinoGlue.cpp
* Simplify Ublox code
Ublox comes in a myriad of versions and settings. Presently our
configuration code does a lot of branching based on versions being
or not being present.
This patch adds version detection earlier in the piece and branches
on the set gnssModel instead to create separate setup methods for Ublox 6,
Ublox 7/8/9, and Ublox10.
Additionally, adds a macro to make the code much shorter and more
readable.
* Make trunk happy
* Make trunk happy
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Honor TFT_MESH color if defined for Heltec T114 or T190
* Temporary: point lib_deps at fork of Heltec's ST7789 library
For demo only, until ST7789 is merged
* Update lib_deps; tidy preprocessor logic
* PMSA0031 sensors require ~3secs before coming up on I2C
As reported by @MALAONE1 and debugged by @shodan8192 , PMSA0031s
on a RAK4631 take 3 seconds before they can become detectable on I2c.
Add a delay(4000) before I2C scan if the air quality sensor pin
is defined.
Fixes https://github.com/meshtastic/firmware/issues/3690
* Remove 4 second wait and rescan during air quality init for the sensor
* works without but this triggers my OCD
---------
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
As discovered and tested by @Mictronics, default Serial FIFO size
on the Pico is 32bytes, which is not enough for GPS messages.
This patch increases the Serial GPS FIFO buffer size to 256
for the RP2040 Architecture
fixes https://github.com/meshtastic/firmware/issues/3989
QMC5883L and HMC5883L are 3-axis compasses which are often confused.
As reported by @Africmod, we had the wrong I2C address for the QMC5883L.
This patch fixes the address and adds its HMC5883L so we keep info
about both.
Fixes https://github.com/meshtastic/firmware/issues/4144
This getACK is used to look for ASCII responses, so print ASCII
when GPS_DEBUG is enabled.
This markedly assisted with recent AG3335 debugging. It works great
with other chips too (tested eg ATGM336H). Even UBLOX prints
understandable "GPTXT,01,01,01,PDTI inv format*35." responses.
Credit to bluebrolly. on discord.
* Added STK8xxxx Accelerometer chip
Added detection of STK8BA53 to I2C scanner.
Change the way and order MCP9808, lLISH3DH and STK8BA53 is detected since they all shares the same I2C address.
* Accelerometer support Radiomaster Bandit.
Enables tap to wake screen if enabled in config,
* Trunk
Trunk
* Add option to preserve private key for factory reset (config)
* Typo fix
* Copy the key in the right direction, and set the size.
* Don't set the key size back to 0 right after setting it to 32.
* Set the key size before using it to do a memcpy.
* Use the right key_size for backing up private_key
* Don't factoryReset() for a missing nodeDB
* Disable Bluetooth in AdminModule when resetting device settings or nodeDB to avoid race
* Add checks for valid objects before deinit bluetooth
* Add disableBluetooth to handleSetConfig, handleSetModuleConfig, and commit settings
---------
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
* All the debug
* Change `memccpy()` to `memcpy()`
* Brint all the bytes of the MAC Address from the NodeDB
* Check for blank MAC Address in ourown NodeDB entry
* One more `memccpy()`
* Clean-up debug log
---------
Co-authored-by: GUVWAF <thijs@havinga.eu>
if u8i == 135, then u8i++ runs, the loop exits since u8i == 136,
then value for u8i is 136 after the for loop.
then in the next line, ntc_res2[u8i] will read past the end
of the array
At the moment if the result of sleepTime calculations comes out
to zero, we put the GPS into HARDSLEEP (losing all its status) and
then immediately make it ACTIVE again.
This patch avoids that toga.
fixes https://github.com/meshtastic/firmware/issues/4657
AG33352 is a Mediatek/Airoha GPS/GLONASS/Galileo/BeiDou receiver.
Patch adds relevant detection and setup code.
Thanks to Bluebrolly and kongduino for providing the relevant
information and testing.
This patch also fixes support for the A3335, which is a related chip.
The setup and detection code now works as tested on a real life
T-1000E!
Thanks to @gpsfan for the guidance.
* Don't filter PKI packets just for being encrypted.
* Add ok_to_mqtt config and bit
* Bitfield
* Adjust dontmqttmebro logic.
* Manipulate bitfield only in router.cpp
* Want_ack is not want_response
* Bitfield macros
* Use new Bitfield macro in MQTT.cpp
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This patch takes inspiration from our I2CDetect code where we have
many sensors that can be detected rather simply. It creates a new
macro,
PROBE_SIMPLE(Chip name, Command to run, response, Driver, timeout)
and converts existing simple cases to use this macro.
* tryfix #4384 - don't assume we want that functionality if the Accelerometer was found. This is only for T-Watch
* Add config.display.wake_on_tap_or_motion default to RAK
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Fixes (#3618) by allowing more time for slower requests.
Resolve Syslog not maintaining client causing issues on RAK13800.
Resolve Ethernet static IP setting subnet as gateway IP.
Reduce comment and log message ambiguity around API.
Remove duplicate #if !MESHTASTIC_EXCLUDE_WEBSERVER block.
* Same priority packets processed in enqueue order
* Prefer same prio pkts on mesh over new ones.
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* t3s3 e-paper support
* remove GPS autodetect (which leads to crashes during startup when no GPS present)
* update EINK defines
* keep definitions for external GPS connector but disable GPS auto scan by default
* Add support for Adafruit Feather RP2040 with RFM95.
* Update mesh.pb.h
dropping this change from the file generated by the protobuf
* Update mesh.pb.h
remove these reverting changes
* Update mesh.pb.h
oops, missed a comma
security option. Per discussion in https://github.com/meshtastic/firmware/issues/4375
no need to preserve the old options when changing to this new simpler
single boolean because they were newish, rarely used and only for 'advanced'
developers.
(from src/extra_variants/README.md)
This directory tree is designed to solve two problems.
- The ESP32 arduino/platformio project doesn't support the nice "if initVariant() is found, call that after init" behavior of the nrf52 builds (they use initVariant() internally).
- Over the years a lot of 'board specific' init code has been added to init() in main.cpp. It would be great to have a general/clean mechanism to allow developers to specify board specific/unique code in a clean fashion without mucking in main.
So we are borrowing the initVariant() ideas here (by using weak gcc references). You can now define lateInitVariant() if your board needs it.
If you'd like a board specific variant to be run, add the variant.cpp file to an appropriately named
subdirectory and check for \_VARIANT_boardname in the cpp file (so that your code is only built for your board).
You'll need to define \_VARIANT_boardname in your corresponding variant.h file.
See existing boards for examples.
This approach has no added runtime cost.
* Initial support for RadioMaster Bandit.
* Different lighting can be made for Button 1 & 2 on the Bandit.
Changes to AmbientLighting will turn off af shutdown().
* Trunk
* Trunk again.
Added support for Polish OLED characters.
- Custom FONT_SMALL ArialMT_Plain_10_PL
- Automatic selection between Polish and Ukrainian/Russian characters mapping depending on the -D OLED_{LANG_NAME} flage
* Add support for Adafruit Feather RP2040 with RFM95.
* Update mesh.pb.h
dropping this change from the file generated by the protobuf
* Update mesh.pb.h
remove these reverting changes
* Update mesh.pb.h
oops, missed a comma
security option. Per discussion in https://github.com/meshtastic/firmware/issues/4375
no need to preserve the old options when changing to this new simpler
single boolean because they were newish, rarely used and only for 'advanced'
developers.
* Initial support for RadioMaster Bandit.
* Different lighting can be made for Button 1 & 2 on the Bandit.
Changes to AmbientLighting will turn off af shutdown().
* Trunk
* Trunk again.
No need for _V05 and _V03 definitions - I think there was a slight misunderstanding
on how variant files are supposed to _decrease_ #ifdef code in the cpp files.
* Currently only on heltec tracker, but could use ADC_USE_PULLUP on other boards that could benefit
* Thanks @todd-herbert and @StevenCellist for the instructions ;-)
* Remove nasty Heltec_wireless #ifdefs that got somehow added to Power.cpp, instead use proper variant defs
* Cleanup adc enable/disable code a bit for less copy-paste cruft
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28
* Merge PR #420
* Fixed double and missing Default class.
* Use correct format specifier and fixed typo.
* Removed duplicate code.
* Fix error: #if with no expression
* Fix warning: extra tokens at end of #endif directive.
* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.
* Fix deprecated macros.
* Set RP2040 in dormant mode when deep sleep is triggered.
* Fix array out of bounds read.
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Update main.cpp
Add in TCXO_OPTIONAL variable for tcxoVoltage and a double-check for working in both modes.
* Update SX126xInterface.cpp
Make a change to the tcxoVoltage setting so that TCXO_OPTIONAL works if defined.
* Update variant.h
Added define for TCXO_OPTIONAL and the tcxoVoltage variable.
Added detail on the compatible boards.
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Thanks to user Goyath on Discord, we discovered that in Japan the
250mW radio level requires licensing, and 20mW is the practical
limit. We also discovered that a duty cycle of 10% is needed on
most frequencies.
CH 24-38 920.5-923.5 20mW no airtime restrictions
CH 39-61 923.5-928.1 20mW 10% airtime
After the recent GPS power work we have an clear set of
definitions for turning GPS on and off. Rather than manipulating
specific heltec tracker-related pins in main setu, the relevant
power management code in the GPS module will turn things
on/off later as needed.
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28
* Merge PR #420
* Fixed double and missing Default class.
* Use correct format specifier and fixed typo.
* Removed duplicate code.
* Fix error: #if with no expression
* Fix warning: extra tokens at end of #endif directive.
* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.
* Fix deprecated macros.
* Set RP2040 in dormant mode when deep sleep is triggered.
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Fix LED pinout for T-Echo board marked v1.0, date 2021-6-28
* Merge PR #420
* Fixed double and missing Default class.
* Use correct format specifier and fixed typo.
* Removed duplicate code.
* Fix error: #if with no expression
* Fix warning: extra tokens at end of #endif directive.
* Fix antenna switching logic. Complementary-pin control logic is required on the rp2040-lora board.
* Fix deprecated macros.
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* feature: default to fuzzy GPS location on the Default Channel
* Default to 13
* 13 default
---------
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
* Radio Master Bandit 5-Way Joystick: first draft
Untested on genuine hardware
* "Okay" moves to next frame, even when canned message disabled
* Refactor to allow easier customization
* Implement feedback from testing
* guard toggleGPS()
* show "Shutting down.." screen
* split adhoc ping alert onto two lines
* Don't block while waiting for shutdown
Was preventing the alert from showing
* Adds ASCII logs useful to portudino
Activates ASCII log option when stdout is not a terminal. This is
generally the right thing to do; if not, the behavior can be
overridden in config.yaml using AsciiLogs under Logging. The result
is reasonable system logs for portudino when running under systemd or
the like.
Signed-off-by: Christopher Hoover <ch@murgatroid.com>
Co-authored-by: Christopher Hoover <ch@murgatroid.com>
* Adds ASCII logs useful to portudino
Activates ASCII log option when stdout is not a terminal. This is
generally the right thing to do; if not, the behavior can be
overridden in config.yaml using AsciiLogs under Logging. The result
is reasonable system logs for portudino when running under systemd or
the like.
Signed-off-by: Christopher Hoover <ch@murgatroid.com>
* Add shorterTimeout bool to sendOurNodeInfo
* Respond to likely PKI decode errors with a quick nodeinfo
* Protbufs
* Move to PKI_UNKNOWN_PUBKEY for PKI decode error