Compare commits

...

31 Commits

Author SHA1 Message Date
Ben Meadors
ab959ded0e Bump to 1.2.60 for release 2022-04-26 06:39:31 -05:00
Ben Meadors
2a76a5527a Fix execution halt in nrf devices on assert and add --reboot support on nrf (#1397)
* Fix execution halt in nrf devices on assert

* Peg espressif platform to 3.5.0

* Add reboot to nrf52 devices
2022-04-25 16:48:28 +10:00
Ben Meadors
58d91f0a4b Add battery pin to meshtastic-diy (#1319)
* Add battery pin to meshtastic-diy

* Adc multiplier
2022-03-24 19:18:14 -05:00
Thomas Göttgens
e09aafa13f Merge pull request #1313 from meshtastic/1.2-fix-rotary-encoder
Rotary Encoder Update
2022-03-21 15:43:58 +01:00
Thomas Göttgens
aca95248ee Rotary Encoder Update - play nice with Onebutton and small bugfix - also switches screen on when any input is processed by the broker 2022-03-21 15:16:25 +01:00
mkinney
d81c1c08ee Update version.properties 2022-03-17 13:47:36 -07:00
mkinney
317ce2c9cd Merge pull request #1303 from mkinney/fix_for_dupl_mac_addr
re-init so the duplicate mac address issue on NRF devices will be fixed
2022-03-17 13:47:11 -07:00
Mike Kinney
b2827597fd re-init so the duplicate mac address issue on NRF devices will be fixed 2022-03-17 20:32:15 +00:00
mkinney
6af182228c Update version.properties 2022-03-17 11:51:52 -07:00
mkinney
1246c7bb1e Merge pull request #1301 from mkinney/nrf_factory_reset
try to reset values on nrf using nodeDB methods
2022-03-17 11:49:41 -07:00
Mike Kinney
e6731e28c1 try removing the /prefs dir 2022-03-17 18:33:30 +00:00
Mike Kinney
d57ac39b02 move the factory reset stuff above the ble bonds 2022-03-17 18:08:39 +00:00
Mike Kinney
67bc6b1419 try to reset values on nrf using nodeDB methods 2022-03-17 17:49:02 +00:00
Thomas Göttgens
d328823c03 Destroy HTTPS Client on unpack error (#1279)
This gives you more than one try to update the embedded Web IF without rebooting the device. This can also be cherry-picked for 1.3
2022-03-10 08:28:06 -06:00
Sacha Weatherstone
7178d3a2fd Sync fix 2022-03-10 09:03:31 +11:00
Ben Meadors
a0f60f1d07 Putting this test back in 2022-03-06 08:18:20 -06:00
Ben Meadors
b177313e2d Removing test simulator for now 2022-03-06 07:57:04 -06:00
Ben Meadors
53d47146b2 Attempt to push artifacts to another repo 2022-03-06 07:38:55 -06:00
mkinney
f7c6955736 Update version.properties 2022-03-01 16:25:58 -08:00
mkinney
9a87e1b53e Merge pull request #1266 from mkinney/bug_fixes
remove assert; revert a change that cpplint reported as a warning
2022-03-01 16:11:34 -08:00
Mike Kinney
f1478a7c93 remove assert; revert a change that cpplint reported as a warning 2022-03-02 00:00:31 +00:00
Jm Casler
8fd5d83980 Merge branch '1.2-legacy' of https://github.com/meshtastic/Meshtastic-device into 1.2-legacy 2022-02-27 07:30:00 -08:00
Jm Casler
5895aaa259 Revert "updating proto submodule to latest"
This reverts commit 682f988c2a.
2022-02-27 07:29:31 -08:00
Jm Casler
1787712a5a Revert "updating proto submodule to latest"
This reverts commit d56f8c631b.
2022-02-27 07:29:25 -08:00
Ben Meadors
596a73c0a0 Peg protos to 1.2 ref and bump version for release 2022-02-27 09:27:56 -06:00
Jm Casler
d56f8c631b updating proto submodule to latest 2022-02-26 21:22:31 -08:00
Jm Casler
682f988c2a updating proto submodule to latest 2022-02-26 21:09:18 -08:00
Ben Meadors
ce20a2b566 Github action to allow 1.2-legacy release 2022-02-26 13:04:25 -06:00
joshpirihi
d0fc836f0b Position packets generated locally should be sent to the phone too (#1242)
* Position packets generated locally should be sent to the phone too
2022-02-26 07:37:23 -06:00
Ben Meadors
d542267e4a Add after-checks for PR checks 2022-02-25 17:06:44 -06:00
Ben Meadors
756317e7e0 Legacy CI fix 2022-02-25 16:52:54 -06:00
20 changed files with 106 additions and 43 deletions

View File

@@ -1,8 +1,8 @@
name: Continuous Integration
name: Continuous Integration PR Checks (1.2 Legacy)
on:
# # Triggers the workflow on push but only for the master branch
push:
branches: [ master ]
branches: [ 1.2-legacy ]
paths-ignore:
- '**.md'
- '**.yml'
@@ -10,7 +10,7 @@ on:
# Note: This is different from "pull_request". Need to specify ref when doing checkouts.
pull_request_target:
branches: [ master ]
branches: [ 1.2-legacy ]
paths-ignore:
- '**.md'
- '**.yml'
@@ -76,6 +76,16 @@ jobs:
- name: Check ${{ matrix.board }}
run: bin/check-all.sh ${{ matrix.board }}
after-checks:
runs-on: ubuntu-latest
needs: [check]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
build-esp32:
strategy:
@@ -321,12 +331,15 @@ jobs:
name: debug-elfs-${{ steps.version.outputs.version }}.zip
path: ./*.elf
retention-days: 90
- name: Create request artifacts
if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }}
uses: gavv/pull-request-artifacts@v1.0.0
with:
commit: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifacts-branch: artifacts
artifacts-token: ${{ secrets.ARTIFACTS_TOKEN }}
artifacts-repo: meshtastic/artifacts
artifacts-branch: device
artifacts-dir: pr
artifacts: ./firmware-${{ steps.version.outputs.version }}.zip

View File

@@ -1,13 +1,13 @@
name: Make Release
on:
# Can optionally take parameters from the github UI, more info here https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/#:~:text=You%20can%20now%20create%20workflows,the%20workflow%20is%20run%20on.
workflow_dispatch:
#workflow_dispatch:
# inputs:
# Only want to run if version.properties is bumped in master
push:
branches:
- master
- 1.2-legacy
paths:
- 'version.properties'

View File

@@ -78,7 +78,7 @@ debug_tool = jlink
lib_deps =
https://github.com/meshtastic/esp8266-oled-ssd1306.git#d90231dedbb2f52bd7a32fb8ed8edec52cf4a8cb ; ESP8266_SSD1306
https://github.com/meshtastic/OneButton.git#3bcba9492d01e2a8a86f46700ab16f96dd2cf1f5 ; OneButton library for non-blocking button debounce
mathertel/OneButton@^2.0.3 ; OneButton library for non-blocking button debounce
1202 ; CRC32, explicitly needed because dependency is missing in the ble ota update lib
https://github.com/meshtastic/arduino-fsm.git
https://github.com/meshtastic/SparkFun_Ublox_Arduino_Library.git#31015a55e630a2df77d9d714669c621a5bf355ad
@@ -121,7 +121,7 @@ lib_deps =
; Common settings for ESP targes, mixin with extends = esp32_base
[esp32_base]
extends = arduino_base
platform = espressif32
platform = espressif32@3.5.0
src_filter =
${arduino_base.src_filter} -<nrf52/>
upload_speed = 921600
@@ -264,4 +264,4 @@ monitor_port = /dev/ttyUSB0
monitor_speed = 115200
# For experimenting with RAM sizes
# board_build.ldscript = linker/nrf52840_s140_sim832.ld
# board_build.ldscript = linker/nrf52840_s140_sim832.ld

View File

@@ -279,6 +279,12 @@ void PowerFSM_setup()
powerFSM.add_transition(&stateON, &stateSHUTDOWN, EVENT_SHUTDOWN, NULL, "Shutdown");
powerFSM.add_transition(&stateSERIAL, &stateSHUTDOWN, EVENT_SHUTDOWN, NULL, "Shutdown");
// Inputbroker
powerFSM.add_transition(&stateLS, &stateON, EVENT_INPUT, NULL, "Input Device");
powerFSM.add_transition(&stateNB, &stateON, EVENT_INPUT, NULL, "Input Device");
powerFSM.add_transition(&stateDARK, &stateON, EVENT_INPUT, NULL, "Input Device");
powerFSM.add_transition(&stateON, &stateON, EVENT_INPUT, NULL, "Input Device"); // restarts the sleep timer
powerFSM.add_transition(&stateDARK, &stateON, EVENT_BLUETOOTH_PAIR, NULL, "Bluetooth pairing");
powerFSM.add_transition(&stateON, &stateON, EVENT_BLUETOOTH_PAIR, NULL, "Bluetooth pairing");

View File

@@ -20,6 +20,7 @@
#define EVENT_POWER_DISCONNECTED 14
#define EVENT_FIRMWARE_UPDATE 15 // We just received a new firmware update packet from the phone
#define EVENT_SHUTDOWN 16 //force a full shutdown now (not just sleep)
#define EVENT_INPUT 17 // input broker wants something, we need to wake up and enable screen
extern Fsm powerFSM;
extern State statePOWER, stateSERIAL;

View File

@@ -1,4 +1,5 @@
#include "InputBroker.h"
#include "PowerFSM.h" // needed for event trigger
InputBroker *inputBroker;
@@ -13,6 +14,7 @@ void InputBroker::registerSource(Observable<const InputEvent *> *source)
int InputBroker::handleInputEvent(const InputEvent *event)
{
powerFSM.trigger(EVENT_INPUT);
this->notifyObservers(event);
return 0;
}

View File

@@ -54,7 +54,7 @@ int32_t RotaryEncoderInterruptBase::runOnce()
}
else if (this->action == ROTARY_ACTION_CCW)
{
DEBUG_MSG("Rotary event CW\n");
DEBUG_MSG("Rotary event CCW\n");
e.inputEvent = this->_eventCcw;
}
@@ -84,7 +84,7 @@ void RotaryEncoderInterruptBase::intAHandler()
return;
}
this->rotaryLevelA = currentLevelA;
intHandler(
this->rotaryStateCCW = intHandler(
currentLevelA == HIGH,
this->rotaryLevelB,
ROTARY_ACTION_CCW,

View File

@@ -295,7 +295,11 @@ class ButtonThread : public OSThread
static void userButtonPressed()
{
// DEBUG_MSG("press!\n");
powerFSM.trigger(EVENT_PRESS);
#ifdef BUTTON_PIN
if ((BUTTON_PIN != radioConfig.preferences.rotary1_pin_press) || !radioConfig.preferences.canned_message_plugin_enabled) {
powerFSM.trigger(EVENT_PRESS);
}
#endif
}
static void userButtonPressedLong()
{
@@ -710,6 +714,8 @@ void powerCommandsCheck()
#ifndef NO_ESP32
DEBUG_MSG("Rebooting for update\n");
ESP.restart();
#elif NRF52_SERIES
NVIC_SystemReset();
#else
DEBUG_MSG("FIXME implement reboot for this platform");
#endif

View File

@@ -71,17 +71,7 @@ int MeshService::handleFromRadio(const MeshPacket *mp)
printPacket("Forwarding to phone", mp);
nodeDB.updateFrom(*mp); // update our DB state based off sniffing every RX packet from the radio
fromNum++;
if (toPhoneQueue.numFree() == 0) {
DEBUG_MSG("NOTE: tophone queue is full, discarding oldest\n");
MeshPacket *d = toPhoneQueue.dequeuePtr(0);
if (d)
releaseToPool(d);
}
MeshPacket *copied = packetPool.allocCopy(*mp);
assert(toPhoneQueue.enqueue(copied, 0)); // FIXME, instead of failing for full queue, delete the oldest mssages
sendToPhone((MeshPacket *)mp);
return 0;
}
@@ -161,12 +151,16 @@ bool MeshService::cancelSending(PacketId id)
return router->cancelSending(nodeDB.getNodeNum(), id);
}
void MeshService::sendToMesh(MeshPacket *p, RxSource src)
void MeshService::sendToMesh(MeshPacket *p, RxSource src, bool ccToPhone)
{
nodeDB.updateFrom(*p); // update our local DB for this packet (because phone might have sent position packets etc...)
// Note: We might return !OK if our fifo was full, at that point the only option we have is to drop it
router->sendLocal(p, src);
if (ccToPhone) {
sendToPhone(p);
}
}
void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies)
@@ -213,6 +207,20 @@ NodeInfo *MeshService::refreshMyNodeInfo()
return node;
}
void MeshService::sendToPhone(MeshPacket *p) {
if (toPhoneQueue.numFree() == 0) {
DEBUG_MSG("NOTE: tophone queue is full, discarding oldest\n");
MeshPacket *d = toPhoneQueue.dequeuePtr(0);
if (d)
releaseToPool(d);
}
MeshPacket *copied = packetPool.allocCopy(*p);
perhapsDecode(copied);
assert(toPhoneQueue.enqueue(copied, 0)); // FIXME, instead of failing for full queue, delete the oldest mssages
fromNum++;
}
int MeshService::onGPSChanged(const meshtastic::GPSStatus *newStatus)
{
// Update our local node info with our position (even if we don't decide to update anyone else)

View File

@@ -75,7 +75,7 @@ class MeshService
/// Send a packet into the mesh - note p must have been allocated from packetPool. We will return it to that pool after
/// sending. This is the ONLY function you should use for sending messages into the mesh, because it also updates the nodedb
/// cache
void sendToMesh(MeshPacket *p, RxSource src = RX_SRC_LOCAL);
void sendToMesh(MeshPacket *p, RxSource src = RX_SRC_LOCAL, bool ccToPhone = false);
/** Attempt to cancel a previously sent packet from this _local_ node. Returns true if a packet was found we could cancel */
bool cancelSending(PacketId id);
@@ -83,6 +83,9 @@ class MeshService
/// Pull the latest power and time info into my nodeinfo
NodeInfo *refreshMyNodeInfo();
/// Send a packet to the phone
void sendToPhone(MeshPacket *p);
private:
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
/// returns 0 to allow futher processing

View File

@@ -97,14 +97,23 @@ bool NodeDB::resetRadioConfig()
nvs_flash_erase();
#endif
#ifdef NRF52_SERIES
Bluefruit.begin();
DEBUG_MSG("Clearing bluetooth bonds!\n");
bond_print_list(BLE_GAP_ROLE_PERIPH);
bond_print_list(BLE_GAP_ROLE_CENTRAL);
// first, remove the "/prefs" (this removes most prefs)
FS.rmdir_r("/prefs");
// second, install default state (this will deal with the duplicate mac address issue)
installDefaultDeviceState();
// third, write to disk
saveToDisk();
Bluefruit.begin();
DEBUG_MSG("Clearing bluetooth bonds!\n");
bond_print_list(BLE_GAP_ROLE_PERIPH);
bond_print_list(BLE_GAP_ROLE_CENTRAL);
Bluefruit.Periph.clearBonds();
Bluefruit.Central.clearBonds();
Bluefruit.Periph.clearBonds();
Bluefruit.Central.clearBonds();
#endif
didFactoryReset = true;
}

View File

@@ -58,7 +58,7 @@ class PhoneAPI
// Call this when the client drops the connection, resets the state to STATE_SEND_NOTHING
// Unregisters our observer. A closed connection **can** be reopened by calling init again.
void close();
virtual void close();
/**
* Handle a ToRadio protobuf

View File

@@ -276,7 +276,7 @@ bool perhapsDecode(MeshPacket *p)
if (p->which_payloadVariant == MeshPacket_decoded_tag)
return true; // If packet was already decoded just return
assert(p->which_payloadVariant == MeshPacket_encrypted_tag);
//assert(p->which_payloadVariant == MeshPacket_encrypted_tag);
// Try to find a channel that works with this hash
for (ChannelIndex chIndex = 0; chIndex < channels.getNumChannels(); chIndex++) {

View File

@@ -755,7 +755,7 @@ void handleUpdateSPIFFS(HTTPRequest *req, HTTPResponse *res)
if (!TARUnpacker->tarStreamExpander(streamptr, streamSize, SPIFFS, "/static")) {
res->printf("tarStreamExpander failed with return code #%d\n", TARUnpacker->tarGzGetError());
Serial.printf("tarStreamExpander failed with return code #%d\n", TARUnpacker->tarGzGetError());
client->stop();
return;
} else {
/*
@@ -773,6 +773,7 @@ void handleUpdateSPIFFS(HTTPRequest *req, HTTPResponse *res)
} else {
res->printf("Failed to establish http connection\n");
Serial.println("Failed to establish http connection");
client->stop();
return;
}

View File

@@ -32,8 +32,8 @@ void __attribute__((noreturn)) __assert_func(const char *file, int line, const c
{
DEBUG_MSG("assert failed %s: %d, %s, test=%s\n", file, line, func, failedexpr);
// debugger_break(); FIXME doesn't work, possibly not for segger
while (1)
; // FIXME, reboot!
// Reboot cpu
NVIC_SystemReset();
}
void getMacAddr(uint8_t *dmac)
@@ -193,4 +193,4 @@ void clearBonds() {
nrf52Bluetooth->setup();
}
nrf52Bluetooth->clearBonds();
}
}

View File

@@ -1,5 +1,6 @@
#include "configuration.h"
#include "CannedMessagePlugin.h"
#include "PowerFSM.h" // neede for button bypass
#include "MeshService.h"
// TODO: reuse defined from Screen.cpp
@@ -111,8 +112,13 @@ int CannedMessagePlugin::handleInputEvent(const InputEvent *event)
if (event->inputEvent == static_cast<char>(InputEventChar_KEY_SELECT))
{
DEBUG_MSG("Canned message event Select\n");
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT;
validEvent = true;
// when inactive, call the onebutton shortpress instead. Activate Module only on up/down
if (this->runState == CANNED_MESSAGE_RUN_STATE_INACTIVE) {
powerFSM.trigger(EVENT_PRESS);
}else{
this->runState = CANNED_MESSAGE_RUN_STATE_ACTION_SELECT;
validEvent = true;
}
}
if (validEvent)

View File

@@ -121,7 +121,9 @@ void PositionPlugin::sendOurPosition(NodeNum dest, bool wantReplies)
p->priority = MeshPacket_Priority_BACKGROUND;
prevPacketId = p->id;
service.sendToMesh(p);
//send to the mesh, and the phone
service.sendToMesh(p, RX_SRC_LOCAL, true);
}
int32_t PositionPlugin::runOnce()

View File

@@ -36,3 +36,7 @@ cstyleCast
// ignore stuff that is not ours
*:.pio/*
*:*/libdeps/*
// these two caused issues
missingOverride
virtualCallInConstructor

View File

@@ -9,6 +9,8 @@
//#define GPS_TX_PIN 12 // not connected
#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam
#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k)
#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Plugin (#975).
#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets)
@@ -45,4 +47,4 @@
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
// (which is the default for the sx1262interface code)
#define SX126X_E22
#endif
#endif

View File

@@ -1,4 +1,4 @@
[VERSION]
major = 1
minor = 2
build = 55
build = 60