Commit graph

175 commits

Author SHA1 Message Date
Dan Halbert
6ec5d3fabe web_workflow.c: use absolute path 2024-06-05 23:29:47 -04:00
Dan Halbert
3f4d9310ff CircuitPython files: replace STATIC with static 2024-05-20 11:02:17 -04:00
Dan Halbert
747b7619ea update headers of most CircuitPython-only files 2024-05-17 14:56:28 -04:00
Scott Shawcroft
b63d422768
Fix more boards and docs 2024-04-23 16:04:42 -07:00
Dan Halbert
bb9968215c Runtime.serial_bytes_available: return count isntead of bool 2024-04-04 12:26:06 -04:00
Dan Halbert
d8bd26c560
Merge pull request #9005 from jepler/issue8980
Postpone interacting with the web workflow if a SPI bus is locked
2024-03-05 12:00:33 -05:00
c0064dcf9f Postpone interacting with the web workflow if a SPI bus is locked
I tested this by fetching a .txt file repeatedly using curl while
running the fancy camera demo. (100+ times without failure). I also
repeatedly loaded the filesystem view http://.../fs/#/sd/ which worked
10+ times without failure, but does take some time (multiple seconds) to
show a listing with a few dozen files.

(I suspect there's an accidentally quadratic behavior in oofatfs to stat
every file in a directory, because it repeatedly does a linear search of
the directory for the stat information of each file, but that's not an
issue for Right Now(TM))

Closes: #8980
2024-03-04 20:23:37 -06:00
Scott Shawcroft
ddf9aec00e
Grab FS lock to test writability
Checking is_writable_from_python always follows USB policy even if
it is unplugged. Fixes #8986

Also does bare minimum for #8961.
2024-02-29 14:05:11 -08:00
Scott Shawcroft
9537b1dca7
Improve neopixel on ESP
Greedily grab as much RMT memory as we can. It blocks other RMT
transmit channels but we only use it temporarily anyway. The more
we can grab, the fewer interrupts are needed to keep the transmit
going.

Flickers may still happen due to file system writes but most of the
time the animation just pauses.

On ESP32, move CircuitPython to the second core. This helps NeoPixel
by moving the RMT interrupt to the second core as well.

When testing ESP32 I noticed that settings.toml writes won't apply
until after hard reset. This removes that constraint but still
requires the password to enable the web workflow.

Fixes #3835
2024-02-14 15:10:07 -08:00
Scott Shawcroft
234ce7cfa4
Fix move, mkdir and tweak dir listing
Makes sure mount point is a directory.

Fixes #8110 by making it explicit that progress is per-file.
2024-01-18 14:22:16 -08:00
Scott Shawcroft
25e862d110
Make SD cards available over web workflow
This changes storage.mount() to require that a mount point exist
on the parent file system.

A bug in background tasks is also fixed where the function
parameter is cleared on pending callbacks during "reset".

Disk usage is shown on the directory listing and changes based on
the mounted file system. Writable is also loaded per-directory.

Fixes #8108. Fixes #8690. Fixes #8107.
2024-01-16 14:12:16 -08:00
2f325740c2
Merge remote-tracking branch 'origin/8.2.x' into merge-8.2.x 2023-12-29 15:05:19 -06:00
CarsonCoder
211c307f79 At proto support for espressif port + global 2023-12-23 17:59:31 -05:00
Dan Halbert
c3f8e0f551
Merge pull request #8667 from tannewt/ww_large_file
Improve web workflow error handling
2023-11-28 23:24:55 -05:00
Scott Shawcroft
96b0c211d1
Fix websocket input processing
It was skipped in many cases which breaks ctrl-cing running code.

Fixes #8132
2023-11-28 14:10:37 -08:00
Scott Shawcroft
8208ca3c6f
Improve web workflow error handling
* Disable Nagle at the end of error messages so they are sent before
  the socket is closed.
* Correctly discard file contents when the PUT file is too large.
* Correctly reset file size after failure to setting it too large.
* Change diskinfo.json to be list of disks in preparation of supporting
  multiple disks.
* Bump version to 3 for the above change.
* Document diskinfo.json.

Fixes #8109
2023-11-28 12:02:33 -08:00
Daniel James
f9d3ec5027
Support for publishing TXT records via mDNS
- Update lwIP+Raspberry Pi implementation to use lwIP API correctly
- Add translations
2023-10-30 20:39:38 -07:00
774f6ac6ab
Switch to using MP_ERROR_TEXT instead of translate, globally 2023-10-30 09:49:06 +01:00
RetiredWizard
5dfe92ba8e web_workflow: adjust indent and move #endif 2023-10-24 16:30:19 -04:00
Scott Shawcroft
5a19971efd
Fix pre-commit 2023-10-16 10:46:11 -07:00
Scott Shawcroft
9633c4e78f
Merge remote-tracking branch 'adafruit/main' into v1.20-merge 2023-10-11 11:21:57 -07:00
Scott Shawcroft
2910dea6fd
Almost fix extra_coverage test 2023-10-11 10:04:02 -07:00
Scott Shawcroft
4087960dfd
Fix MDNS. C3 works 2023-09-14 15:04:07 -07:00
Bill Sideris
5869af395e
Wifi fully seperate from web-workflow 2023-09-05 22:39:41 +03:00
Bill Sideris
9eaae37dfc
When no password is passed, connect to wifi but do not init web_workflow. 2023-09-05 19:31:18 +03:00
Ted Hess
9c45551880 Do not enable web_workflow background callbacks if wifi is not enabled/connected 2023-05-11 17:01:53 -04:00
Ted Hess
ccbb6a58fb Fix web-editor debug on non-standard port using localhost (CORS) 2023-04-22 13:09:18 -04:00
Scott Shawcroft
09c2c5ef0e
Merge pull request #7876 from thess/CORS-update
Simplify CORS checks and don't restrict host names.
2023-04-19 11:07:34 -07:00
Ted Hess
8980ebfa16 Simplify CORS checks and don't restrict host names.
Minor socket cleanup.
2023-04-18 22:09:48 -04:00
Ted Hess
27a97dec16 Static web pages:
- Move loading .js scripts from <head> to <body> for faster rendering
   - Enable back-button support for file system/editor navigation
   - Close WebSocket when navigating away from /cp/serial
   - Use better looking Blinka icon.
2023-04-16 15:53:07 -04:00
Isaac Benitez
532283d1a5 Replace malloc() with static varible 2023-04-10 20:58:21 -07:00
Isaac Benitez
e38b5491f4 Add device name env variable for web workflow 2023-04-07 11:45:13 -07:00
Ted Hess
9825b7fbb7 Web Workflow sockets and threads handling improvements.
Fixes polling thread looping forever hangs preventing new connections.
Don't lose listening sockets on mp resets and re-init.
Keep better separation of "system" and "user" sockets.
Track socket states to prevent re-use of sockets before closed.
Close REST socket when transaction completes. No post-init.
Remove unnecessary state flags.
2023-04-05 13:50:42 -04:00
Ted Hess
1a5afd485b Allow web_workflow to startup after deep sleep alarm wakeup 2023-03-29 15:47:17 -04:00
foamyguy
0773a2bd6d increment web_api_version 2023-03-20 17:32:00 -05:00
foamyguy
a1506df805 implement real diskinfo functionality 2023-03-17 21:36:13 -05:00
foamyguy
408406c84f starting diskinfo api 2023-03-14 18:09:18 -05:00
root
59f56a438a Fix for issue #7054 by avoiding recursive calls to websocket_background. 2023-03-08 13:09:45 -06:00
Scott Shawcroft
5c517b7e5a
Handle MDNS deinited better. 2023-01-12 11:24:20 -08:00
Scott Shawcroft
ca80f30348
Share the web workflow MDNS object with the user
Fixes #7369
2023-01-11 16:05:19 -08:00
e817563ca0
Update cyw43-driver, fix no-password wifi
Now, open wifi works on Pico W, so this closes #7438.

For the web workflow it's now OK to either
 * specify an empty password string (as before)
 * not have the CIRCUITPY_WIFI_PASSWORD key at all (new functionality)
2023-01-10 15:07:17 -06:00
Scott Shawcroft
f8ac1d9261
Rework the coproc API
It is now a generic `memorymap` API and an ESP specific `espulp` module.

Fixes #7218. Fixes #3234. Fixes #7300.
2022-12-19 14:08:38 -05:00
808161eaab
fix missing sentinel in call 2022-12-12 19:09:57 -06:00
3620d14542
Pass string length when enabling radio 2022-12-12 17:04:03 -06:00
1b15985783
Fix web workflow builds 2022-12-12 09:20:56 -06:00
44f15d563d
Rename "environ" errors to "getenv" errors 2022-12-09 14:14:53 -06:00
3a92c079fc
Finish renaming os_environ_get_key to os_getenv
.. for consistency.
2022-12-09 14:07:23 -06:00
3459fe322b
Withdraw the _environ module
This existed solely for testing, so expose it a different way during
the unix coverage build

Also turn off os.getenv support on samd21.
2022-12-08 15:33:10 -06:00
ef2bfdb5db
dotenv becomes settings.toml 2022-12-08 12:44:20 -06:00
Scott Shawcroft
b354cec8cb
Three small ESP web workflow fixes
* Set nonblock on all accepted sockets. Not just ones for user code.
* Close an open websocket if another is accepted.
* Set debug level to INFO rather than DEBUG because DEBUG crashes
  on ESP32-S3 USB OTG.
2022-12-06 11:49:04 -08:00