-
Notifications
You must be signed in to change notification settings - Fork 370
Configurator as Web APP (PWA) #2448
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
base: master
Are you sure you want to change the base?
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
|
I think websockets wrap it in HTTP requests. They aren't raw sockets, as I understand it. Both Electron and PWA support web sockets, though. So one solution would be something along these lines, roughly: BUUUUT I have another idea in mind I'm going to try. |
This commit fixes issues in the transpiler API definitions where
the configurator did not match the actual INAV firmware implementation.
Issues Fixed:
1. waypoint.js (CRITICAL):
- Fixed wrong operand type (was 5/GVAR, now 7/WAYPOINTS)
- Removed 6 fabricated properties not in firmware (latitude, longitude,
altitude, bearing, missionReached, missionValid)
- Added 14 actual properties from firmware (isWaypointMission, number,
action, nextAction, distance, distanceFromPrevious, user action flags)
2. gvar.js (HIGH):
- Fixed wrong operand type (was 3/FLIGHT_MODE, now 5/GVAR)
- Fixed wrong operation (was 19/GVAR_INC, now 18/GVAR_SET)
3. pid.js (MAJOR):
- Removed fabricated properties not in firmware (setpoint, measurement,
P/I/D/FF gains, enabled)
- Kept only 'output' property which is actually exposed (operands 0-3)
- Changed from i*10+0..7 mapping to direct i mapping
4. flight.js (MEDIUM):
- Added missing wind parameters 46-49:
minGroundSpeed, horizontalWindSpeed, windDirection, relativeWindOffset
5. inav_constants.js (MEDIUM):
- Added missing FLIGHT_PARAM constants 46-49
- Added missing OPERATION constant 56 (OVERRIDE_MIN_GROUND_SPEED)
6. codegen.js (LOW):
- Fixed RC channel regex to support both rc[N] and rc[N].value syntax
Testing:
- Added 5 comprehensive test files (test_rc_channels, test_gvar, test_pid,
test_waypoint, test_flight)
- All fixes verified against firmware source code:
- src/main/programming/logic_condition.h
- src/main/programming/logic_condition.c
- src/main/programming/global_variables.h
- src/main/programming/pid.h
Files verified correct (no changes needed):
- override.js (all 10 operations match firmware)
- rc.js (correctly handled by codegen)
Documentation:
- API_BUGS_FOUND.md: Initial issue analysis
- VERIFICATION_SUMMARY.md: Complete verification findings
- FIXES_COMPLETE.md: Final fix summary with cross-references
Breaking Changes:
- pid[N].configure(), pid[N].setpoint, pid[N].enabled no longer available
(these never existed in firmware, only pid[N].output works)
- waypoint.latitude/longitude/altitude/bearing no longer available
(these are not exposed through logic condition system)
Firmware References:
- logic_condition.h lines 92-102 (operand types)
- logic_condition.h lines 104-155 (flight parameters)
- logic_condition.h lines 177-192 (waypoint parameters)
- logic_condition.c lines 575-669 (waypoint implementation)
- logic_condition.c lines 1078-1082 (PID implementation)
This commit fixes issues in the transpiler API definitions where
the configurator did not match the actual INAV firmware implementation.
Issues Fixed:
1. waypoint.js (CRITICAL):
- Fixed wrong operand type (was 5/GVAR, now 7/WAYPOINTS)
- Removed 6 fabricated properties not in firmware (latitude, longitude,
altitude, bearing, missionReached, missionValid)
- Added 14 actual properties from firmware (isWaypointMission, number,
action, nextAction, distance, distanceFromPrevious, user action flags)
2. gvar.js (HIGH):
- Fixed wrong operand type (was 3/FLIGHT_MODE, now 5/GVAR)
- Fixed wrong operation (was 19/GVAR_INC, now 18/GVAR_SET)
3. pid.js (MAJOR):
- Removed fabricated properties not in firmware (setpoint, measurement,
P/I/D/FF gains, enabled)
- Kept only 'output' property which is actually exposed (operands 0-3)
- Changed from i*10+0..7 mapping to direct i mapping
4. flight.js (MEDIUM):
- Added missing wind parameters 46-49:
minGroundSpeed, horizontalWindSpeed, windDirection, relativeWindOffset
5. inav_constants.js (MEDIUM):
- Added missing FLIGHT_PARAM constants 46-49
- Added missing OPERATION constant 56 (OVERRIDE_MIN_GROUND_SPEED)
6. codegen.js (LOW):
- Fixed RC channel regex to support both rc[N] and rc[N].value syntax
Testing:
- Added 5 comprehensive test files (test_rc_channels, test_gvar, test_pid,
test_waypoint, test_flight)
- All fixes verified against firmware source code:
- src/main/programming/logic_condition.h
- src/main/programming/logic_condition.c
- src/main/programming/global_variables.h
- src/main/programming/pid.h
Files verified correct (no changes needed):
- override.js (all 10 operations match firmware)
- rc.js (correctly handled by codegen)
Documentation:
- API_BUGS_FOUND.md: Initial issue analysis
- VERIFICATION_SUMMARY.md: Complete verification findings
- FIXES_COMPLETE.md: Final fix summary with cross-references
Breaking Changes:
- pid[N].configure(), pid[N].setpoint, pid[N].enabled no longer available
(these never existed in firmware, only pid[N].output works)
- waypoint.latitude/longitude/altitude/bearing no longer available
(these are not exposed through logic condition system)
Firmware References:
- logic_condition.h lines 92-102 (operand types)
- logic_condition.h lines 104-155 (flight parameters)
- logic_condition.h lines 177-192 (waypoint parameters)
- logic_condition.c lines 575-669 (waypoint implementation)
- logic_condition.c lines 1078-1082 (PID implementation)
Updated test documentation to reflect fixed state and improve code quality: 1. test_flight.js: - Removed outdated 'KNOWN ISSUE' header (params 46-49 are now present) - Updated to use FLIGHT_PARAM_NAMES constant instead of Object.keys().find() - Cleaner and more performant parameter name lookup 2. test_pid.js: - Replaced 'KNOWN BUG TO DETECT' with 'FIRMWARE DESIGN' explanation - Clarified that firmware intentionally exposes only PID outputs - Removed 'bug' language as this is intentional firmware design These changes address feedback from PR review bot.
Removed gvar.js and override.js as they are not used by the transpiler. Analysis shows: - gvar.js: Completely bypassed by hardcoded gvar handling in codegen.js (lines 598-610) and action_generator.js (lines 98, 108, 118, 133, 141) - override.js: Bypassed by hardcoded operation mapping in codegen.js (lines 705-719) Both files contained only documentation that duplicated information already hardcoded in the transpiler implementation. Removing them reduces maintenance burden and eliminates confusion from misleading values (gvar.js had wrong type and operation values that were never actually used). Files modified: - Deleted: js/transpiler/api/definitions/gvar.js - Deleted: js/transpiler/api/definitions/override.js - Updated: js/transpiler/api/definitions/index.js (removed imports/exports)
The previous commit removed override.js but forgot to update the import statement in js/transpiler/index.js, causing build failures: "Could not resolve ./api/definitions/override.js" Changes: - Removed import of overrideDefinitions from index.js (line 23) - Removed overrideDefinitions from export list (line 40) Build verified successful with npm run make.
…ividual objects - Updated all tabs to replace the global TABS object with individual tab objects (e.g., loggingTab, magnetometerTab, etc.). - Changed the way active tabs are set by comparing against the tab object instead of string literals. - Exported each tab object for better modularity and maintainability. - Ensured all tab initialization and cleanup functions are correctly referenced to their respective objects. This should help to optimise the tabs and prevent some of the tabs from loading incorrectly in PWA.
This reverts commit 6735ae3.
|
Have you seen https://www.inav-config.online/ ? |
|
Could you please add a note to the public view of the online configurator at https://www.inav-config.online/ , if that is yours, telling users who happen to find it that it is under development. A user reported that he had used it. |
|
To be honest, I don't think it's a good idea to just put the unfinished version online. If you want to test it, you can find the GH pages version in my repo. By the way, more will follow soon. I still have something else to finish (info coming soon). |
*** Work in Progess ***
Preview, only partially working now: https://scavanger.github.io/inav-configurator
Working:
To do:
Not working, :
- SITL (and probably won't)Webasssembly/emscripten version already in developmentTCP would be possible via WebSockets, but somehow it doesn't connect properly with SITL. INAV SITL says it's connected, but web serial remains stuck on ‘connecting’. Bug in INAV, TCP handshake problem?
-> No, Websocket ist just raw data wrapped in a HTTP request. Emscripten has a warpper to emulate RAW TCP Sockets, but iits very unreliable and slow.
Solution:
Things to consider:
Any other suggestions?