diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index e44b86089..000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/ubuntu/.devcontainer/base.Dockerfile - -# [Choice] Ubuntu version: bionic, focal -ARG VARIANT="focal" -FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} - -# [Optional] Uncomment this section to install additional OS packages. -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install python3-distutils python3-pip -RUN pip3 install platformio meshtastic adafruit-nrfutil -RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip -O /tmp/protoc.zip && cd /tmp && unzip protoc.zip && chmod a+x bin/protoc && cp bin/protoc /usr/local/bin diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index e0a284e88..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,32 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/ubuntu -{ - "name": "Ubuntu", - "build": { - "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick an Ubuntu version: focal, bionic - "args": { "VARIANT": "focal" } - }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "platformio.platformio-ide", - "xaver.clang-format" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "uname -a", - - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - - "postCreateCommand": "git submodule update --init" -} \ No newline at end of file diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml index 2791f65e1..5bb61e267 100644 --- a/.github/workflows/update_protobufs.yml +++ b/.github/workflows/update_protobufs.yml @@ -29,5 +29,5 @@ jobs: uses: peter-evans/create-pull-request@v3 with: add-paths: | - proto + protobufs src/mesh diff --git a/.gitmodules b/.gitmodules index 59efcedd3..489f01bea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "proto"] - path = proto +[submodule "protobufs"] + path = protobufs url = https://github.com/meshtastic/Meshtastic-protobufs.git -[submodule "design"] - path = design - url = https://github.com/meshtastic/meshtastic-design.git diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a61ccd24..c2bc7b28c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -73,10 +73,5 @@ "cmake.configureOnOpen": true, "protoc": { "compile_on_save": false, - "compile_all_path": "/home/kevinh/development/meshtastic/meshtastic-esp32/proto", - "options": [ - "--java_out=/tmp", - "-I=/home/kevinh/development/meshtastic/meshtastic-esp32/proto" - ] } } \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 146ff8878..000000000 --- a/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu -MAINTAINER Kevin Hester - -RUN apt-get update -RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install wget python3 g++ zip python3-venv git vim -RUN wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py; chmod +x get-platformio.py -RUN python3 get-platformio.py -RUN git clone https://github.com/meshtastic/Meshtastic-device.git -RUN cd Meshtastic-device; git submodule update --init --recursive -# only build the simulator -RUN sed -i 's/^BOARDS_ESP32.*/BOARDS_ESP32=""/' Meshtastic-device/bin/build-all.sh -RUN sed -i 's/^BOARDS_NRF52.*/BOARDS_NRF52=""/' Meshtastic-device/bin/build-all.sh -RUN sed -i 's/echo "Building Filesystem.*/exit/' Meshtastic-device/bin/build-all.sh -RUN . ~/.platformio/penv/bin/activate; cd Meshtastic-device; ./bin/build-all.sh - -CMD ["/Meshtastic-device/release/latest/bins/universal/meshtasticd_linux_amd64"] diff --git a/bin/regen-protos.bat b/bin/regen-protos.bat index 39e1f3507..158991414 100644 --- a/bin/regen-protos.bat +++ b/bin/regen-protos.bat @@ -1 +1 @@ -cd proto && ..\nanopb-0.4.5\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\proto *.proto +cd protobufs && ..\nanopb-0.4.5\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index 9f3e33127..0f46d270b 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -7,8 +7,8 @@ echo "meshtastic-device root directory if the following step fails, you should d echo "prebuilt binaries for your computer into nanopb-0.4.5" # the nanopb tool seems to require that the .options file be in the current directory! -cd proto -../nanopb-0.4.5/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../proto *.proto +cd protobufs +../nanopb-0.4.5/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto #echo "Regenerating protobuf documentation - if you see an error message" #echo "you can ignore it unless doing a new protobuf release to github." diff --git a/design b/design deleted file mode 160000 index 73ba05cee..000000000 --- a/design +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 73ba05ceef8beff81eb546a0b9e8ecad03a1216d diff --git a/proto b/protobufs similarity index 100% rename from proto rename to protobufs diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 629ebc5a4..818836ac5 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -146,7 +146,7 @@ bool NodeDB::resetRadioConfig() void NodeDB::installDefaultConfig() { memset(&config, 0, sizeof(config)); - config.payloadVariant.device.ntp_server[0] = '0.pool.ntp.org'; + *config.payloadVariant.device.ntp_server = '0.pool.ntp.org'; } void NodeDB::installDefaultModuleConfig() diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index b07ef8054..65aeab4c6 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -171,14 +171,6 @@ void AdminModule::handleSetOwner(const User &o) service.reloadOwner(); } -// void AdminModule::handleSetRadio(RadioConfig &r) -// { -// // writeSecret(r.preferences.wifi_password, radioConfig.preferences.wifi_password); -// radioConfig = r; - -// service.reloadConfig(); -// } - void AdminModule::handleSetConfig(const Config &c) { switch (c.which_payloadVariant) { @@ -270,29 +262,6 @@ void AdminModule::handleGetOwner(const MeshPacket &req) } } -// void AdminModule::handleGetRadio(const MeshPacket &req) -// { -// if (req.decoded.want_response) { -// // We create the reply here -// AdminMessage res = AdminMessage_init_default; -// res.get_radio_response = radioConfig; - -// // NOTE: The phone app needs to know the ls_secs & phone_timeout value so it can properly expect sleep behavior. -// // So even if we internally use 0 to represent 'use default' we still need to send the value we are -// // using to the app (so that even old phone apps work with new device loads). -// // res.get_radio_response.preferences.ls_secs = getPref_ls_secs(); //TODO: Re-implement if necceasry -// // res.get_radio_response.preferences.phone_timeout_secs = getPref_phone_timeout_secs(); //TODO: Re-implement if -// necceasry -// // hideSecret(r.get_radio_response.preferences.wifi_ssid); // hmm - leave public for now, because only minimally -// private -// // and useful for users to know current provisioning) -// // hideSecret(res.get_radio_response.preferences.wifi_password); - -// res.which_variant = AdminMessage_get_radio_response_tag; -// myReply = allocDataProtobuf(res); -// } -// } - void AdminModule::handleGetConfig(const MeshPacket &req, const uint32_t configType) { AdminMessage res = AdminMessage_init_default; @@ -302,22 +271,28 @@ void AdminModule::handleGetConfig(const MeshPacket &req, const uint32_t configTy case AdminMessage_ConfigType_DEVICE_CONFIG: DEBUG_MSG("Getting config: Device\n"); res.get_config_response.which_payloadVariant = Config_device_tag; + res.get_config_response.payloadVariant.device = config.payloadVariant.device; break; case AdminMessage_ConfigType_POSITION_CONFIG: DEBUG_MSG("Getting config: Position\n"); res.get_config_response.which_payloadVariant = Config_position_tag; + res.get_config_response.payloadVariant.position = config.payloadVariant.position; break; case AdminMessage_ConfigType_POWER_CONFIG: DEBUG_MSG("Getting config: Power\n"); res.get_config_response.which_payloadVariant = Config_power_tag; + res.get_config_response.payloadVariant.power = config.payloadVariant.power; break; case AdminMessage_ConfigType_WIFI_CONFIG: DEBUG_MSG("Getting config: WiFi\n"); res.get_config_response.which_payloadVariant = Config_wifi_tag; + res.get_config_response.payloadVariant.wifi = config.payloadVariant.wifi; + writeSecret(res.get_config_response.payloadVariant.wifi.psk, config.payloadVariant.wifi.psk); break; case AdminMessage_ConfigType_DISPLAY_CONFIG: DEBUG_MSG("Getting config: Display\n"); res.get_config_response.which_payloadVariant = Config_display_tag; + res.get_config_response.payloadVariant.display = config.payloadVariant.display; break; case AdminMessage_ConfigType_LORA_CONFIG: DEBUG_MSG("Getting config: LoRa\n");