Coder Social home page Coder Social logo

openshock / firmware Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 6.0 7.81 MB

Espressif Firmware for OpenShock, Controlling shock collars via Reverse engineered proprietary Sub-1 GHz Protocols.

License: GNU Affero General Public License v3.0

C++ 69.95% CSS 0.05% HTML 0.06% Python 5.96% JavaScript 0.15% TypeScript 21.83% Svelte 1.78% C 0.22%
cpp electrostim espressif sveltekit reverse-engineering sub1ghz openshock petrainer shock-collars estim

firmware's People

Contributors

dependabot[bot] avatar hhvrc avatar lucheart avatar nullstalgia avatar redmushie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

firmware's Issues

[Bug] Show example/pre-set RMT pin definitions on Setup page

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

If using a PCB/pre-existing design, there should be a placeholder pin set in the RMT pin input on the Setup page.

If not, it should fall back to a known good pin for the board.

Other remarks

Maybe in Wiki, we can have a listing of recommended RMT pins? Mark out which pins are recommended? (Not used by SPI flash, aren't input-only, etc)

Add README

This repo currently has no README.

Requirements

  • Repository description
  • List compatible hardware
  • Instructions for flashing the firmware
  • Instructions for contributing?

[Feature] VisualStateManager should be able to handle RGB+Normal LED

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

On my PCB, it is possible to show a more complex current state of the software.

Possibly using normal LED like other boards do, except commands sent to shockers are displayed on the RGB LED?

Other remarks

I'll likely be tackling a big part of this, as well as merging in the RGB library I have soon.

[Bug] Serial commands not working / not saving data / not triggering a connect

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Not board specific

Firmware version

1.0.0-rc.1

Flashing method

ESP Tool JS

Describe what happened as precisely as possible.

Serial commands (networks, authtoken) dont seem to work at all.
I cant figure out how to save networks, even after looking into the code I cannot get it to work. The validation also seems to not work since i can just give it bogus data and it will say its okay.

Describe what you expected to happen instead.

For the commands to work properly as to be expected.

In as much detail as possible, describe the exact steps you took to make the problem appear.

  1. set a network via the networks command [{"ssid": "myNetworkName", "password": "myNetworkPassword"}]
  2. restart the device
  3. see it not being saved

Other remarks

No response

Add UI feedback after connecting to network

I connected to the network successfully as I confirmed this via the serial monitor, but there is zero visual feedback in the captive portal that the connection was established.

[Feature] UI Feedback when setting Pair code and RMT Pin on Setup

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

Currently, there is no feedback when providing a pair code or RMT pin in the setup page.

There should be either a toast or a modal confirming the action, successful or otherwise.

Other remarks

No response

[Bug] Saved networks via serial command is not trying to be connected to

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

D1 Mini

Firmware version

1.0.0-rc.3

Flashing method

esptool.exe write_flash 0x0 path

Describe what happened as precisely as possible.

When saving the networks of the device via the serial command, it saves perfectly fine, however even after restarting it does not try to connect to the saved network.

Describe what you expected to happen instead.

For it to connect to the network i saved on restart.

In as much detail as possible, describe the exact steps you took to make the problem appear.

serial into the esp.

use the networks command properly
[{"ssid":"LucsNet","password":"MyNetworkPasswordLalala"}]

Other remarks

No response

[Feature] Have a warning on changing RF TX pins on pre-defined boards

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

For boards like PiShock Lite/2023 or my own PCBs, a user changing the RF TX pin should be discouraged/warned against.

Currently the only relevant information is on the Wiki, and having the pins pre-set in the UI during setup.

I think the only thing that's missing at this point is a warning stating that the pin has already been set by their choice of firmware, and that changing it is not recommended.

For generic WEMOS, Seeed, etc dev boards, leaving the RF pin undefined in the platformio.ini could be used as a way to suppress that warning, letting the user enter their chosen pin.

Other remarks

No response

[Feature] Support changing OpenShock server at runtime

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

Cofiguring the OpenShock server that the firmware connects to should be modifiable at runtime, not compile time.

  • Add serial command to change server
  • Add (prefilled) text field with baked-in URL as default value

Other remarks

No response

Add central config manager using flatbuffers

Add central config manager for basic settings that dont get changed that often.

This would be needed because having one file per options is VERY inefficient, each file created takes up 4k bytes in LittleFS so this would clog up the file system fast.

We can implement this when Flatbuffers gets merged into develop because it makes all of this really easy

[Bug] Fix logging project-wide

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Wemos Lolin S3

Firmware version

1.0.0-rc1

Flashing method

I flashed via platformIO using the correct board config.

Describe what happened as precisely as possible.

Certain logs never appeared.

Describe what you expected to happen instead.

Logs appearing from CommandHandler.cpp telling me what was the reason for it failing

In as much detail as possible, describe the exact steps you took to make the problem appear.

Run and monitor the uploaded firmware, look at the logs.

Other remarks

This can be fixed by having a "Logging.h" or similar file where you implement this:

#pragma once

#include <esp32-hal.h>
#include <esp_log.h>

then replace all instances of #include <esp_log.h> with this and remove any references to #include <HardwareSerial.h> and #include <esp32-hal.h>

Several "file does not exist" errors upon serving captive portal

[ 12255][V][WiFiGeneric.cpp:421] _arduino_event_cb(): AP Station IP Assigned:10.10.10.11
[ 12256][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 14 - AP_STAIPASSIGNED
[ 23051][E][vfs_api.cpp:105] open(): /littlefs/www/fa/fa-all.css does not exist, no permits for creation
[ 23098][E][vfs_api.cpp:105] open(): /littlefs/www/_app/immutable/assets/1.css does not exist, no permits for 
creation
[ 23191][E][vfs_api.cpp:105] open(): /littlefs/www/_app/immutable/assets/0.css does not exist, no permits for 
creation
[ 23282][E][vfs_api.cpp:105] open(): /littlefs/www/_app/immutable/entry/4.js does not exist, no permits for creation
[ 23368][E][vfs_api.cpp:105] open(): /littlefs/www/_app/immutable/chunks/9.js does not exist, no permits for creation
[ 23657][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 23658][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 23658][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 23660][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 24080][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 24083][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 24084][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 24084][W][AsyncTCP.cpp:930] _poll(): pcb is NULL
[ 24136][D][CaptivePortalInstance.cpp:37] handleWebSocketClientConnected(): [CaptivePortalInstance] WebSocket 
client #0 connected from 10.10.10.11

[Feature] Rewrite include/Board.h to take all ESP chips into account

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

This only accounts for a single chip, it should take all chips into account

Other remarks

No response

[Bug] [CI] Restore old naming scheme for release firmware bin

With 1.1.0 the naming scheme for the firmware merged bin's has changed. It does NOT include the version anymore. This leads to not knowing what firmware version a certain bin is.

This was previously different, dont exactly know why it was changed.

E.g. currently: OpenShock_Wemos-D1-Mini-ESP32_stable

What it should really be is something like: OpenShock_Wemos-D1-Mini-ESP32_stable_1.1.1
for beta this would be OpenShock_Wemos-D1-Mini-ESP32_beta_1.1.1-rc.1

[Feature] Add compilation warning when no LED is defined

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

being able to see in build logs something that stands out to someone who is compiling a project indicating that LED pin will not have a preset default.

Other remarks

No response

[Bug] Board crashes when loading captive portal

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Pishock 2023

Firmware version

1.0.0-rc.2

Flashing method

I used esptool write_flash 0x0 <image>

Describe what happened as precisely as possible.

When connecting to the captive wifi network and trying to load the captive portal, the board crashes, and the page doesn't finish loading:

After 1 attempt:
Screenshot_2023-10-31-07-49-54-66_3aea4af51f236e4932235fdada7d1643

Then, reconnecting to the wifi network (since it crashed), trying to load it again:
Screenshot_2023-10-31-07-51-14-51_3aea4af51f236e4932235fdada7d1643

The board crashes again.

Serial monitor logs:

image

Describe what you expected to happen instead.

Captive portal should load without the board crashing and the wifi connection dropping as a result.

In as much detail as possible, describe the exact steps you took to make the problem appear.

  1. Connect to OpenShock wifi network
  2. Visit http://10.10.10.10/
  3. (The board crashes while the page is loading)

Other remarks

No response

[Bug] ESP crashes when connected network shuts down

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Wemos-D1-Mini-ESP32

Firmware version

1.0.0-rc.4

Flashing method

Built and uploaded via PlatformIO

Describe what happened as precisely as possible.

The ESP connected to a wifi network and connected to the gateway.
The network shut down and the ESP crashed and restarted.

Describe what you expected to happen instead.

It to gracefully release the resources it had allocated and re-launch the captive portal.

In as much detail as possible, describe the exact steps you took to make the problem appear.

  1. Launch a mobile hotspot or something else you can turn on/off
  2. Set up your ESP to connect normally to the gateway via this network.
  3. Once ESP is connected, abruptly shut down the WiFi network

Other remarks

This is not a important bug to solve as the esp returns to the captive portal after reboot, its just an annoying issue.

[Bug] Gateway pairing fails despite network connection

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Pishock 2023

Firmware version

1.0.0-rc.4

Flashing method

Instructions per RELEASE.md

Describe what happened as precisely as possible.

UI (these were taken right after each other):

IMG_20231108_193407
IMG_20231108_193433

Logs:

[106470][V][WiFiManager.cpp:289] Save(): [WiFiManager] Authenticating to network ...
[106568][V][WiFiManager.cpp:126] _connectImpl(): [WiFiManager] Connecting to network ... (...)
[106592][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
[107951][V][WiFiGeneric.cpp:355] _arduino_event_cb(): STA Connected: SSID: ..., BSSID: ..., Channel: 6, Auth: WPA2_PSK       
[107953][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
[107960][I][WiFiManager.cpp:194] _evWiFiConnected(): [WiFiManager] Connected to network ... (...)

Describe what you expected to happen instead.

Gateway pairing should succeed, since internet connection is established

In as much detail as possible, describe the exact steps you took to make the problem appear.

  • Connect to wifi in captive portal
  • Try to pair to gateway
  • [Get error]

Other remarks

No response

ESP32 Panics when connecting to WiFi network

Happens when connecting to a WiFi network trough the Cative Portal

Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x420c3779  PS      : 0x00060b30  A0      : 0x820bc734  A1      : 0x3fceb0f0  
A2      : 0x3fceb2f0  A3      : 0x00000001  A4      : 0x3fceb2f0  A5      : 0x3fceb0f2  
A6      : 0x000000ca  A7      : 0x3fceb0f0  A8      : 0x00000000  A9      : 0x00000008  
A10     : 0x000000a5  A11     : 0x00000001  A12     : 0x00000000  A13     : 0x00000010  
A14     : 0x00000068  A15     : 0x3fceb480  SAR     : 0x00000018  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x000000a5  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xfffffffb  


Backtrace: 0x420c3776:0x3fceb0f0 0x420bc731:0x3fceb480 0x42007d51:0x3fceb540 0x42008edd:0x3fceb9c0 0x420d0e89:0x3fcebb20 0x42030025:0x3fcebb50 0x42030051:0x3fcebb80 0x420d1ab9:0x3fcebba0 0x420306ab:0x3fcebbc0 0x420d1b8f:0x3fcebbf0 0x420309d9:0x3fcebc20 0x42030aa6:0x3fcebc50 0x42030c2e:0x3fcebc70 0x42030d62:0x3fcebcd0 0x420309d9:0x3fcebcf0 0x42030aa6:0x3fcebd20 0x42030b19:0x3fcebd40 0x42030cd1:0x3fcebd80 0x42030d62:0x3fcebde0 0x420309d9:0x3fcebe00 0x42030aa6:0x3fcebe30 0x42030b19:0x3fcebe50 0x42030b8e:0x3fcebe90 0x42030d46:0x3fcebef0 0x4202ff2d:0x3fcebf10 0x4202ffe2:0x3fcebf50 0x42030001:0x3fcebf70 0x4200ad5e:0x3fcebf90 0x420205d2:0x3fcebfb0 0x42037779:0x3fcebfd0


ELF file SHA256: bd2a1aecfa708864

[Bug] Open WiFi networks cannot be connected to

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

D1 Mini

Firmware version

1.0.0

Flashing method

xxx

Describe what happened as precisely as possible.

Tried to connect the ESP to a open wifi network.

Describe what you expected to happen instead.

Open networks should be able to be connected to

In as much detail as possible, describe the exact steps you took to make the problem appear.

  • Have a WiFi Network with no password (open)
  • Try to connect to it from the captive portal
  • Clicking the button does nothing
  • Serial-log reveals error

Other remarks

[642589][E][WiFiNetworkSaveCommand.cpp:26] HandleWiFiNetworkSaveCommand(): [LocalMessageHandlers] WiFi message is missing required properties

[Bug] RTM Pin not changed on runtime only on restart

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Pishock 2023

Firmware version

1.0.0-rc.4

Flashing method

esptool via powershell

Describe what happened as precisely as possible.

RTMPIN setting does not change on runtime, only saves and gets applied after restart

Describe what you expected to happen instead.

should apply on runtime without the need of a restart

In as much detail as possible, describe the exact steps you took to make the problem appear.

setup esp and change rtm pin setting without restart

Other remarks

nope thanks for listening to my ted talk

[Feature] Add UI status for receiving IP address

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

Add UI toast message to show when the ESP has been given an IP address by the DHCP server, if this never happens it can be very confusing to the user or developer.

adresses #111

Other remarks

No response

[Feature] Serial commands to read out exisiting config values

Pre-submission checklist

  • I checked that there is no other Feature Request describing my wish.
  • I checked that this feature is, in fact, not supported.
  • I accept that this issue may be closed if any of the above are found to be untrue.

What should be possible that currently is not?

We need to be able to read out the current network configuration and rmt pin. Auth Token is not needed and can be write only to strengthen security a bit.

Reason for this need is the flash tool, for it to auto copy wifi and rmt pin config values when updating the firmware for a better user experience.

Other remarks

No response

[Bug] ESP32 Sometimes gets stuck in scanning state

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

ESP32-S3 'Dorx'

Firmware version

develop

Flashing method

I used PlatformIO with S3 Platform configured for 8MB flash

Describe what happened as precisely as possible.

Connect to captive portal, esp reports scan_done, then if you try to scan again, it will report scan already in progress, which is false.

Describe what you expected to happen instead.

It to begin scanning.

In as much detail as possible, describe the exact steps you took to make the problem appear.

Unclear, rare bug.

Other remarks

No response

[Bug] Captive UI should correctly show whether network is known or not

Pre-submission checklist

  • I checked that no other Bug Report describing my problem exists.
  • I am running the latest stable or prerelease firmware.
  • My board is on the list of maintained boards.
  • I accept that this issue may be closed if any of the above are found to be untrue.

Board

Pishock 2023

Firmware version

1.0.0-rc.4

Flashing method

See RELEASE.md

Describe what happened as precisely as possible.

After you connect to a WiFi network, the network list does not accurately show that the network you connected to is now a known network.

Until you reboot the board, it keeps showing as unknown network.

The reverse is also true when pressing the Forget Network button.

Describe what you expected to happen instead.

Network list should accurately show whether a network is known or not, after you change that fact

In as much detail as possible, describe the exact steps you took to make the problem appear.

Option 1:

  • Successfully connect to previously unknown wifi network
  • The network list keeps showing said wifi network as not having any saved credentials

Option 2:

  • Go to a known networks' settings
  • Press "Forget"
  • The network list keeps showing said wifi network as having saved credentials

Other remarks

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.