Merge branch 'meshtastic:master' into master

This commit is contained in:
Michele 2021-05-25 23:06:36 +02:00
commit cfeb0b47e9
11 changed files with 99 additions and 55 deletions

View File

@ -59,14 +59,14 @@ jobs:
pio upgrade
# We now run integration test before other build steps (to quickly see runtime failures)
#- name: Build for native
# run: platformio run -e native
#- name: Integration test
# run: |
# .pio/build/native/program &
# sleep 20 # 5 seconds was not enough
# echo "Simulator started, launching python test..."
# python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
- name: Build for native
run: platformio run -e native
- name: Integration test
run: |
.pio/build/native/program &
sleep 20 # 5 seconds was not enough
echo "Simulator started, launching python test..."
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'
# - name: Build for tbeam
# run: platformio run -e tbeam

View File

@ -49,7 +49,7 @@ jobs:
# Will be available in steps.version.outputs.version
- name: Get version string
run: echo "::set-output name=version::$(./bin/buildinfo.py)"
run: echo "::set-output name=version::$(./bin/buildinfo.py long)"
id: version
- name: Build everything

View File

@ -1,6 +1,8 @@
set -e
echo "This script is only for developers who are publishing new builds on github. Most users don't need it"
VERSION=`bin/buildinfo.py`
VERSION=`bin/buildinfo.py long`
# Must have a V prefix to trigger github
git tag "v${VERSION}"

9
bin/test-simulator.sh Executable file
View File

@ -0,0 +1,9 @@
set -e
echo "Starting simulator"
.pio/build/native/program &
sleep 20 # 5 seconds was not enough
echo "Simulator started, launching python test..."
python3 -c 'from meshtastic.test import testSimulator; testSimulator()'

View File

@ -2,25 +2,21 @@
You probably don't care about this section - skip to the next one.
## before next release
* fix python tool problem with windows and the heartbeat
* admin remote nodes reboot sometimes https://github.com/meshtastic/Meshtastic-device/issues/811
* router mode dropping messages? https://meshtastic.discourse.group/t/router-mode-missing-messages/3329/3
* fix ttgo eink screen
* fix this sleep problem: https://meshtastic.discourse.group/t/new-device-release-1-2-30-ready-for-alpha-testing/3272/13?u=geeksville
* make native sim not touch hardware
* reenable sim in CI builds
* list portduino on platformio
* figure our wss for mqtt.meshtastic - use cloudflare? 2052 ws, 2053 crypt
* release android APK - fix recent 1.2.28 crash report
* turn on setTx(timeout) and state = setDioIrqParams(SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT, SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT); in sx1262 code
* pine64 lora module
* @havealoha fixedposition not working
* @luxonn reports that after a while the android app stops showing new messages
* ask for vercel access
* finish plan for riot.im
* turn on setTx(timeout) and state = setDioIrqParams(SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT, SX126X_IRQ_TX_DONE | SX126X_IRQ_TIMEOUT); in sx1262 code
* add rak4600 support (with rf95 radio and limited ram)
* Switch to use https://github.com/adafruit/Adafruit_nRF52_Arduino.git when available (see arduino code for examples)
* DONE @luxonn reports that after a while the android app stops showing new messages
* DONE release android APK - fix recent 1.2.28 crash report
* DONE remote admin busted?
* DONE check android code - @havealoha comments about odd sleep behavior
* ABANDONED test github actions locally on linux

View File

@ -425,13 +425,24 @@ lib_deps =
SparkFun BQ27441 LiPo Fuel Gauge Arduino Library
TFT_eSPI
; The Portduino based sim environment on top of linux
; The Portduino based sim environment on top of any host OS, all hardware will be simulated
[env:native]
platform = https://github.com/geeksville/platform-native.git
src_filter = ${env.src_filter} -<esp32/> -<nimble/> -<nrf52/> -<mesh/http/> -<plugins/esp32>
build_flags = ${arduino_base.build_flags} -O0 -lgpiod
build_flags = ${arduino_base.build_flags} -O0
framework = arduino
board = native
board = cross_platform
lib_deps =
${arduino_base.lib_deps}
rweather/Crypto
; The Portduino based sim environment on top of a linux OS and touching linux hardware devices
[env:linux]
platform = https://github.com/geeksville/platform-native.git
src_filter = ${env.src_filter} -<esp32/> -<nimble/> -<nrf52/> -<mesh/http/> -<plugins/esp32>
build_flags = ${arduino_base.build_flags} -O0 -lgpiod
framework = arduino
board = linux_hardware
lib_deps =
${arduino_base.lib_deps}
rweather/Crypto

View File

@ -45,7 +45,7 @@ int32_t StreamAPI::readStream()
} else if (ptr >= HEADER_LEN - 1) { // we have at least read our 4 byte framing
uint32_t len = (rxBuf[2] << 8) + rxBuf[3]; // big endian 16 bit length follows framing
console->printf("len %d\n", len);
// console->printf("len %d\n", len);
if (ptr == HEADER_LEN - 1) {
// we _just_ finished our 4 byte header, validate length now (note: a length of zero is a valid

View File

@ -32,11 +32,10 @@ bool isWifiAvailable()
{
// If wifi status is connected, return true regardless of the radio configuration.
if (isSoftAPForced()) {
return 1;
return true;
}
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
// strcpy(radioConfig.preferences.wifi_ssid, "meshtastic");
// strcpy(radioConfig.preferences.wifi_password, "meshtastic!");
@ -47,10 +46,10 @@ bool isWifiAvailable()
// radioConfig.preferences.wifi_ap_mode = true;
// radioConfig.preferences.wifi_ap_mode = false;
if (*wifiName && *wifiPsw) {
return 1;
if (*wifiName) {
return true;
} else {
return 0;
return false;
}
}
@ -96,7 +95,10 @@ void initWifi(bool forceSoftAP)
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
if ((*wifiName && *wifiPsw) || forceSoftAP) {
if (!*wifiPsw) // Treat empty password as no password
wifiPsw = NULL;
if (*wifiName || forceSoftAP) {
if (forceSoftAP) {
DEBUG_MSG("Forcing SoftAP\n");
@ -178,8 +180,6 @@ void initWifi(bool forceSoftAP)
DEBUG_MSG("Not using WIFI\n");
}
// Called by the Espressif SDK to
static void WiFiEvent(WiFiEvent_t event)
{
@ -304,12 +304,15 @@ void handleDNSResponse()
void reconnectWiFi()
{
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
if (radioConfig.has_preferences) {
if (*wifiName && *wifiPsw) {
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
if (!*wifiPsw) // Treat empty password as no password
wifiPsw = NULL;
if (*wifiName) {
DEBUG_MSG("... Reconnecting to WiFi access point");

View File

@ -22,6 +22,9 @@ class WiFiServerAPI : public StreamAPI
protected:
/// We override this method to prevent publishing EVENT_SERIAL_CONNECTED/DISCONNECTED for wifi links (we want the board to stay in the POWERED state to prevent disabling wifi)
virtual void onConnectionChanged(bool connected) {}
virtual int32_t runOnce(); // Check for dropped client connections
/// Check the current underlying physical link to see if the client is currently connected

View File

@ -1,5 +1,6 @@
#include "CryptoEngine.h"
#include "PortduinoGPIO.h"
#include "SPIChip.h"
#include "mesh/RF95Interface.h"
#include "sleep.h"
#include "target_specific.h"
@ -48,7 +49,7 @@ class PolledIrqPin : public GPIOPin
}
};
GPIOPin *loraIrq;
static GPIOPin *loraIrq;
/** apps run under portduino can optionally define a portduinoSetup() to
* use portduino specific init code (such as gpioBind) to setup portduino on their host machine,
@ -58,26 +59,45 @@ void portduinoSetup()
{
printf("Setting up Meshtastic on Porduino...\n");
// FIXME: remove this hack once interrupts are confirmed to work on new pine64 board
// loraIrq = new PolledIrqPin();
loraIrq = new LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq"); // or "err"?
loraIrq->setSilent();
gpioBind(loraIrq);
#ifdef PORTDUINO_LINUX_HARDWARE
SPI.begin(); // We need to create SPI
bool usePineLora = !spiChip->isSimulated();
if(usePineLora) {
printf("Connecting to PineLora board...\n");
// BUSY hw was busted on current board - just use the simulated pin (which will read low)
auto busy = new LinuxGPIOPin(SX1262_BUSY, "ch341", "slct", "loraBusy");
busy->setSilent();
gpioBind(busy);
//auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy");
//fakeBusy->writePin(LOW);
//fakeBusy->setSilent(true);
//gpioBind(fakeBusy);
// FIXME: remove this hack once interrupts are confirmed to work on new pine64 board
// loraIrq = new PolledIrqPin();
loraIrq = new LinuxGPIOPin(LORA_DIO1, "ch341", "int", "loraIrq"); // or "err"?
loraIrq->setSilent();
gpioBind(loraIrq);
gpioBind(new LinuxGPIOPin(SX1262_RESET, "ch341", "ini", "loraReset"));
// BUSY hw was busted on current board - just use the simulated pin (which will read low)
auto busy = new LinuxGPIOPin(SX1262_BUSY, "ch341", "slct", "loraBusy");
busy->setSilent();
gpioBind(busy);
auto loraCs = new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs");
loraCs->setSilent();
gpioBind(loraCs);
gpioBind(new LinuxGPIOPin(SX1262_RESET, "ch341", "ini", "loraReset"));
auto loraCs = new LinuxGPIOPin(SX1262_CS, "ch341", "cs0", "loraCs");
loraCs->setSilent();
gpioBind(loraCs);
}
else
#endif
{
auto fakeBusy = new SimGPIOPin(SX1262_BUSY, "fakeBusy");
fakeBusy->writePin(LOW);
fakeBusy->setSilent(true);
gpioBind(fakeBusy);
auto cs = new SimGPIOPin(SX1262_CS, "fakeLoraCS");
cs->setSilent(true);
gpioBind(cs);
gpioBind(new SimGPIOPin(SX1262_RESET, "fakeLoraReset"));
gpioBind(new SimGPIOPin(LORA_DIO1, "fakeLoraIrq"));
}
// gpioBind((new SimGPIOPin(LORA_RESET, "LORA_RESET")));
// gpioBind((new SimGPIOPin(RF95_NSS, "RF95_NSS"))->setSilent());

View File

@ -1,4 +1,4 @@
[VERSION]
major = 1
minor = 2
build = 30
build = 38