• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

components/slip_modem/11-Mar-2024-317151

main/11-Mar-2024-300201

CMakeLists.txtD11-Mar-2024235 75

MakefileD11-Mar-2024182 92

README.mdD11-Mar-20243.1 KiB8451

sdkconfig.defaultsD11-Mar-202467 32

README.md

1# SLIP device client
2
3(See the README.md file in the upper level 'examples' directory for more information about examples.)
4
5## Overview
6
7This provides SLIP support for connection to Contiki gateway devices, allowing the ESP platform board to be used to bridge between low-power networks and IP (Wifi / Ethernet).
8
9## How to use example
10
11### Hardware Required
12
13To run this example, you need an ESP32 dev board (e.g. ESP32-WROVER Kit) or ESP32 core board (e.g. ESP32-DevKitC).
14For test purpose, you also need a SLIP capable gateway device, such as anything running [Contiki](https://github.com/contiki-os/contiki) gateway firmware.
15You can also try other modules as long as they implement the SLIP protocol (e.g. linux device with slip module loaded)
16
17#### Setup a test SLIP device
18
19It is possible to configure any device with linux and a serial interface
20(e.g. raspberry PI or a PC with USB to serial bridge) to enable SLIP interface.
21
22To test this example with such device, please follow these steps:
23
24- Configure IPv4 mode in the example configuration menu
25
26- Setup SLIP interface
27```
28slattach -v -L -s 115200 -p slip /dev/ttyAMA0
29```
30where the `/dev/ttyAMA0` is the device's serial port
31
32- Configure IP addresses
33```
34ifconfig sl0 10.0.0.1 dstaddr 10.0.0.2
35```
36where the `10.0.0.2` is IPv4 address of the ESP platform board
37
38- Send and receive back UDP packets, as the example implements UDP echo server
39```
40nc -u 10.0.0.2 5678
41```
42
43#### Pin Assignment
44
45**Note:** The following pin assignments are used by default which can be changed in menuconfig.
46
47| ESP32  | Gateway |
48| ------ | -------------- |
49| GPIO4  | RX             |
50| GPIO36 | TX             |
51| GND    | GND            |
52| 3v3    | VCC            |
53
54### Configure the project
55
56Open the project configuration menu (`idf.py menuconfig`). Then go into `Example Configuration` menu.
57
58- Choose the RX and TX pins
59- Choose port number and IP protocol for socket udp server
60For use in external projects `SLIP support` must be enabled under the `components/lwip` menu.
61
62
63### Build and Flash
64
65Run `idf.py -p PORT flash monitor` to build and flash the project..
66
67(To exit the serial monitor, type ``Ctrl-]``.)
68
69See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects.
70
71
72
73## Troubleshooting
74
751. Invalid slip packets
76
77Many slip devices use additional messages for things like ipv6 prefix configuration (or sending log messages over the SLIP serial port). This is supported in the driver through the use of an `rx_filter` function that is called on receipt of all packets and can be used to filter packets prior to passing them to the stack.
78
792. No packets received
80
81The first layer to check is the serial port, you can enable debugging of the SLIP component by setting the global log level to `DEBUG`, or changing the slip component log levbel with `esp_log_level_set("esp-netif_lwip-slip", ESP_LOG_DEBUG);`
82
83(For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you as soon as possible.)
84