Skip to content

Commit

Permalink
Modified tcp_gateway for packet length management
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYsLab committed Nov 14, 2022
1 parent f732408 commit 38dc3f6
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions python_banyan/utils/tcp_gateway/Running_Demos.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
# Running The Demos

There are two demos available. Currently, data can only be sent in one
direction at a time since I have not figured out how to perform concurrency in
MicroPython. The threading
library is said to be experimental. However, I did locate [this code](https://github.com/fadushin/esp8266/blob/790958fa332592c80a0f81f25cdaa9513d596f64/micropython/uhttpd/uhttpd/__init__.py#L354) which may solve
the concurrency issue. I have yet to have a chance to see if the code works.
A demo is available to run data end-to-end in both directions.

## Sending Messages To The Local Simulated Server From The Pico
Here are the steps used:

1. Start the backplane.
2. Start the [messages_from_pico.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/pico_micropython_scripts/messages_from_pico.py) MicroPython script.
3. Start [sim_messages_from_pico.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/simulated_local_station/sim_messages_from_pico.py)
4. Start the [tcp_gateway.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/tcp_gateway.py)

You should see the messages if you look at the console window for sim_messages_from_pico.py.
The TCP Gateway will continually attempt to connect to the Pico.

## Steps
Here are the steps used:

## Sending Messages From the Local Simulated Server To The Pico
1. Start the backplane.
2. Start the [messages_to_pico.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/pico_micropython_scripts/messages_to_pico.py) MicroPython script.
3. Start the [tcp_gateway.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/tcp_gateway.py)
4. Start the [sim_messages_to_pico.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/simulated_local_station/sim_messages_to_pico.py) script.
2. Start the [tcp_gateway.py](https://github.com/MrYsLab/python_banyan/blob/tcp_gateway/python_banyan/utils/tcp_gateway/tcp_gateway.py)
3. Load and start the [select.py](https://github.com/MrYsLab/python_banyan/blob/master/python_banyan/utils/tcp_gateway/pico_micropython_scripts/select.py) MicroPython script on the Raspberry Pi Pico W
4. Start [sim_echo_client.py](https://github.com/MrYsLab/python_banyan/blob/master/python_banyan/utils/tcp_gateway/simulated_local_station/sim_echo_client.py)

Check the Thonny shell for incoming messages.
The messages appear in the sim_echo_client console and on the MicroPython
Thonny shell.

0 comments on commit 38dc3f6

Please sign in to comment.