-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
[modem] pppos tcp/ip for uart modem (esp-idf only) #6721
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: dev
Are you sure you want to change the base?
Conversation
|
Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration ( |
|
Hey there @esphome/core, mind taking a look at this pull request as it has been labeled with an integration ( |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #6721 +/- ##
=======================================
Coverage 73.27% 73.27%
=======================================
Files 53 53
Lines 11263 11263
Branches 1532 1532
=======================================
Hits 8253 8253
Misses 2612 2612
Partials 398 398 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
oups, initial bad branch push, This is a currently a draft PR, it needs more works. It is currently tested and developed on Lilygo T-SIM7600E. It use esp-modem, so it's I've been able to use There is some modem initialisation that need to be fixed. For now, it's better to start the device from a cold state (with no power). The PPPos data communication is done in CMUX mode, so it should be possible to send other AT command (gnss, gps, etc...) using the command channel (TODO). And I'm sot sure that pppos:
platform: cellular
...
gps:
platform: cellular |
|
Did anyone here have any luck with this? modem:
use_address: <IP>I'm just getting an error when trying to use it |
|
For For the gps boot, the modem component use Let me know if using manually for `"(It shows [modem.nmea_uart:291] Invalid GNSS data in the log, but the satellites number didn't reset)", I will also fix that on the modem side: If GNSS invalid data is found (ie no fix/data), the nmea frame is not sent to the gps component, so the gps use the last known state. On invalid data, the modem should send an empty NMEA frame, so the gps component know that the gps is not fixed. |
If that's the same as the GNSS toggle, its not going to work. switch:
- platform: modem
gnss:
name: "${friendly_name} GNSS"
restore_mode: ALWAYS_ONI managed to create an automation that detects when GPS fails & auto reboots tho, which does get it working again. |
|
This is great work! I also had to set I used |
|
@martivo thanks for testing!
I'm not actively developing the component for the moment, but will be back in few month. |
|
I did some further testing. I hope these logs are useful. I attached full logs, but tried to point out the differences here. With Full log cmux_enabled.txt When I use I tried both OTA configurations: Here is the log when I enable the Full log wifi_enabled.txt If you need more logs or extra information about the configuration then let me know. I would like to help as this would make my setups so much easier. No need for a separate LTE router with this. Normal boot log with wifi and cmux disabled. normal_boot.txt |
The only way to enable OTA updates through the ESPHome dashboard atm is by configuring the WiFi component (just for the AP) and adding Take a look at what I did on https://github.com/ShonP40/Car-Assistant |
|
@martivo , I've bumped esp_modem from 1.4.0 to 1.4.2 . This might fix some bug related to For OTA, I haven't made some test for a while, but it should works with http_request platform: OTA can't be used in the legacy or web_server mode, because the modem has a private IP, and can't be reached from the internet unless you use a wiregard VPN as @ShonP40. (I will have to check for the use of |
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
Removed Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
Removed Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
Removed Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
|
I think something is now broken. It will always give me this error without changing the config. I still use the same external_components. When i remove it and the modem block it is compiling.
@oarcher Thanks! I will give it a try. I already have wireguard working. However I am unable to try anything since I am now unable to compile it after the latest changes.
@ShonP40 Thanks, I will try to set it to AP mode. |
|
@martivo , hare you using lastest dev esphome branch ? as @SeByDocKy noticed in discord, some changes has been introduced because of #11704 |
Hi, no I was using regular release until now. Ill try "dev" and see how it goes. However I now noticed that just adding the |
Do you mean you had both an internet WAN IP address and be able to do OTA over local WiFi ? |
No, I put the wireguard VPN device ip as the |
@oarcher, when I use the Unfortunately the The This update was done over LTE and Wireguard. On a side note: I noticed that esphome dashboard will ping/pull the address all the time and creates quite a lot of traffic. This seems to happen even when the dashboard is not opened in the browser. If your LTE has very limited data capacity, then change |
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
Removed Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |



PR splitted
This PR has been splitted into smaller PRs for easyest review/merge.
This is the complete PR that testers should use.
Review/merge order:
#9801 Network components changes
#9836 Modem component without implementation
#9807 base implementation of the modem component
#6721 modem sensors component (This PR)
#7147 optional, Wifi AP that use the modem connection
What does this implement/fix?
This implement pppos tcp/ip for esp32, on lte/4G networks. It conflict with
ethernetcomponent, but can be used with Wifi AP with #7147The modem component also expose GNSS/GPS location as sensors. Here is a blueprint to set up a device tracker in home assistant:

See:
You can join me on this discord thread
Types of changes
Related issue or feature (if applicable):
fixes esphome/feature-requests#2303
fixes esphome/feature-requests#477
fixes esphome/feature-requests#1379
fixes esphome/feature-requests#1810
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#4056
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed:
Implementation notes
The modem component use esp_modem from espressif, using simple_cmux_client example, and inspired from esphome ethernet component.
Eshome uart component not used
esp_modem need to create and to handle the uart event queue
This conflict with
esphome/esphome/components/uart/uart_component_esp_idf.cpp
Lines 130 to 135 in 32b927d
the
create_uart_dteis a private function in esp_modem. To much code need to be copied and modified.