Skip to content
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

Install/update scripts won't work with Python 3 in some distros #760

Closed
IZ1IVA opened this issue Mar 24, 2021 · 5 comments
Closed

Install/update scripts won't work with Python 3 in some distros #760

IZ1IVA opened this issue Mar 24, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@IZ1IVA
Copy link
Contributor

IZ1IVA commented Mar 24, 2021

Describe the bug
Install and update scripts expect a Python environment, but are unable to locate Python 3 in some distros such as Raspberry Pi OS o Debian.
Symlinks to /usr/bin/python are discouraged, however certain distros such as Ubuntu provide an optional python-is-python3 package which kinda does just that and preserves it across updates.

To Reproduce
Steps to reproduce the behavior:

  1. Try executing the update or install scripts in Debian or Raspberry Pi OS
  2. Observe the script failing:
    Trying to flash update firmware-tlora-v2-1-1.6-1.2.13.bin.
    ./device-update.sh: 42: ./device-update.sh: python: not found
    Erasing the otadata partition, which will turn off flash flippy-flop and force the first image to be used
    ./device-update.sh: 44: ./device-update.sh: python: not found
    or
    Trying to flash firmware-tlora-v2-1-1.6-1.2.13.bin, but first erasing and writing system information
    ./device-install.sh: 44: ./device-install.sh: python: not found

Potential solutions

  1. Mandate Python 3 and modify the scripts accordingly
  2. Make the scripts specifically look for the Python 3 executable whenever an older version is not found
@geeksville
Copy link
Member

@IZ1IVA ooh good find! Option 1 from your list seems fine to me. Would you be willing to send in a PR?

@geeksville geeksville added the bug Something isn't working label Mar 25, 2021
This was referenced Mar 25, 2021
@IZ1IVA
Copy link
Contributor Author

IZ1IVA commented Mar 25, 2021

@IZ1IVA ooh good find! Option 1 from your list seems fine to me. Would you be willing to send in a PR?

I just did it, though I'm definitely not a script guru! Props to @iz1kga for testing on Ubuntu.

@geeksville
Copy link
Member

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/1-2-13-alpha-of-device-android-and-python-code-eagerly-needs-testing/2956/17

@geeksville
Copy link
Member

thanks!

@geeksville
Copy link
Member

fixed in #763

24601 added a commit to 24601/Meshtastic-device that referenced this issue Apr 15, 2021
* fxi log formatting

* check more error codes

* add consolePrintf for C style code

* fix GPS fixme wrt deletion

* turn radio back on

* turn off (buggy) custom_fields in tinygps, and used fixed version of lib

* todo updates

* don't block on segger console

* begin restricting admin ops to the admin channel

* wip - move channels

* completed moving prefs to new files

* minimize radioconfig file writes

* fix null pointer exception in storeandforwardplugin.  if null the vtable is busted
cc @mc-hamster.  In some cases storeForwardPluginRadio can be null ;-)

~/development/meshtastic/meshtastic-esp32$ bin/exception_decoder.py -e .pio/build/tbeam/firmware.elf ex
stack:
0x401db467: StoreForwardPluginRadio::sendPayload(unsigned int, bool) at /home/kevinh/development/meshtastic/meshtastic-esp32/src/plugins/esp32/StoreForwardPlugin.cpp:235
0x400e7cbd: StoreForwardPlugin::runOnce() at /home/kevinh/development/meshtastic/meshtastic-esp32/src/plugins/esp32/StoreForwardPlugin.cpp:225
0x400d4cca: concurrency::OSThread::run() at /home/kevinh/development/meshtastic/meshtastic-esp32/src/concurrency/OSThread.cpp:45
0x400f015d: ThreadController::runOrDelay() at /home/kevinh/development/meshtastic/meshtastic-esp32/.pio/libdeps/tbeam/Thread/ThreadController.cpp:153
0x400da070: loop() at /home/kevinh/development/meshtastic/meshtastic-esp32/src/main.cpp:621
0x400ff709: loopTask(void*) at /home/kevinh/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:19

Signed-off-by: Kevin Hester <kevinh@geeksville.com>

* progress on remote settings

* SERIOUS BUG: we've been discarding devicestate when we should not

* fix nasty bug

* turn on access control for admin plugin, only allow remote access over special channel

* 1.2.9

* cleanup memtest

* turn off linux on CI for now

* fix memory corruption in storeandforward

* fix board reboot due to forwarding packets we don't have keys for

* todo updates

* @mc-hamster, I think storeandforward was accidentally wrong (no worries though)

* 1.2.10

* fix hop limit defaults for android

* lockdown plugins that touch hardware

* cleanup external notification plugin

* remove country from rom support

* Use enums for hw_model per @sachaw idea.

* move hw_model into User

* change hw_model_deprecated to intentionally break old apps

* Fix flash flippy-flop error after commandline update (thanks @stephen304)

* Port to lora_isp4520 board

* Chargeing...

* pitches.h no more

* change portduino so it has a higher chance of building on OS-X and windows

* turn off broken genieblocks_lora build

* remove old intellij defs

* setup for intellij

* progress on Wifi in portduino

* wifi now works on portduino

* Fixed compilation on nrf52 and brownout code

* Fix hardware model

* Partial work on s&f

* #743 - Stub out for "mode 10" - NMEA string.

* Update RangeTestPlugin.md

* add sim exit cmd

* add newline

* add first integration test for CI

* specify clang for c++ formatting conventions

* geeksville todo

* update release test scripts

* todo updates

* fix tlora 1.6 build

* 1.2.11

* Revert clock update for Net quality clocks

* Removed SX1262_USE_DIO3_FOR_TCXO

* WIRE_INTERFACES_COUNT -> NO_WIRE

* only show time on OLED if we have a valid UTC clock

* change android-too-old webpage to be less scary

* TODO updates

* Script to publish nightly builds.

* Update RangeTestPlugin.md

* Update to how S&F reserves space on PSRAM

* Fix small bug in range test plugin.

packetSequence was an unsigned int but i was using %d. oops

* Fixes for build of tlora_v1_3

* move GPS_RX_PIN for the TLORA_V2_1_16 from 36 to 15

* Update build-all for tlora_v1_3

* Update airtime.h to add override

* Update nightly build to use the same release build archive for the nightly

* Add option to set python interpreter used for device-install.sh and device-update.sh

* partial work for S&F

* Update StoreForwardPlugin.cpp

* Push RSSI to the phone

* Return errors for unauthorized requests or out of bound channel nums

* always fix up channel list, even if we just did factory reset

* fix channel !authorized check

* move channel docs into git

* Updated proto

* Fix firmware OTA update while is_router

* tested OTA is_router

* @mc-hamster it is VERY important to not accidentally turn this in in master

;-)

* properly discard messages with fromradio queue is full (Rather than blocking forever)

* fix has_preferences init

* 1.2.13

* update altitude in nodedb for received altitudes (reported by @iz1kga)

* move streamapi into a thread, saves power and increases responsiveness

* PhoneAPIs shouldn't register for messages until they have clients

* cleanly disable bluetooth while serial API is in use (and only then)

* Update device-install.sh

Please have a look at meshtastic#760

* captive portal for Android devices

* change! time of last packet rx in node->last_heard instead of node->position.time

* fix has_gps reporting to phones

* Update StoreForwardPlugin.cpp

* Add a "Development Mode" for our plugins

* meshtastic#758 Report elevation while in range test

* Remove my code that doesn't work with channels

* Update NodeDB.cpp

* Fix bad merge

* Update device-update.sh

Please have a look at meshtastic#760

* add reboot message

* fix nrf52 builds

* meshtastic#669 Add restart counter

* populate position.time for broadcast positions

* meshtastic#669 - Add restart counter

* doc update

* add note about credit!

* fix serious nak bug reported by @havealoha and @Luxoon

* fix unused prefs field

* remove unused Preferences code (cc @mc-hamster for review)
(noticed because of a compiler warning)

* dramatically speed up message RX in some cases (we were sleeping much too long)

* 1.2.17

* fix native build

* Add serial_disabled for meshtastic#638

* Update fo meshtastic#638 - Redid protobuf generation

* fix millisecond unsigned rollover errors found via portduino

* leave phone timeout off a bit longer

* cleanup applyModemConfig based on porduino testing, share with sim

* fix simradio init to work more like real radios

* todo updates

* update proto

* update libs to fix CI build, thanks @meehow!

* fix sign comparsion

* someone made a boo-boo adding "serial_disabled", caused a nasty NPE

* add more time for sim startup

* fix CI build script typo

* test fix for CI tool

* remove unused lib from CI build

* simplify build

* add WIP notes about running github actions locally...

* fix VFS creation bug in native.  fix heap corruption in Fsm free

* add frequency_offset

* 1.2.20

* todo updates

* MQTT at least talks to server, works in native and esp32

* fix warning

* fix nodeid

* MQTT WIP

* we now send packets to mqtt server

* mqtt: send packets after they are encrypted

* mqtt: automatically start or stop as neede & attempt reconnect

* mqtt: only publish uplink_enabled channels

* mqtt: begin subscription support

* allow passing even encrypted packets through the plugins

* note about security

* cleanup packet encrypt/descrypt

* mqtt: downlink now works

* update docs

* fix build for !wifi devices

* run-both should target tbeams

* remove dead code

* Update RangeTestPlugin.md

* Fix GPIO service and cleanup response handling

* fix meshtastic#779.  Add basic GPIO documentation

* 1.2.23

* use real MQTT server DNS name

* use production mqtt server

* Default interpreter to "python" if "python3" doesn't exist

* Allow device-*.sh file to flash to be specified without '-f'

* add is_licensed for ham users

* mqtt: fix downlink check

* 1.2.25

* mqtt: don't downlink messages from us.

* document peer_info

* rak4631: builds but WIP

* lower brownout threshold to 1.7V

* fix redundant segger init

* rak4631: kinda runs

* rak4631: gps now works

* RAK4631 is almost feature complete

* Add RAK4631 to build

Co-authored-by: Kevin Hester <kevinh@geeksville.com>
Co-authored-by: Jm Casler <jm@casler.org>
Co-authored-by: Vadim Furman <vfurman@gmail.com>
Co-authored-by: Tim Gunter <tgunter@gmail.com>
Co-authored-by: IZ1IVA <75425638+IZ1IVA@users.noreply.github.com>
Co-authored-by: Michał Adamski <michal@ert.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants