-
-
Couldn't load subscription status.
- Fork 100
Description
I'm using the following to create a connection a smart device that is hosting a TCP server on port 80. From the smart phone I connect to the broadcasted WiFi of the smart device, then initiate the following TCP connection. The same connection code works otherwise with Android.
TcpSocket.createConnection({
host: '192.168.1.1',
port: 80,
localAddress: ...,
})
Per several hours of debugging and internet search I find that localAddress is required so that is why it is included otherwise I'd omit it. The problem is that when localAddress is "0.0.0.0", not specified, is "192.168.1.1", or anything other than "ap1" (current data port) then the error is:
Unknown interface. Specify valid interface by name (e.g. "en1") or IP address.
When localAddress is "127.0.0.1" or instead I supply interface as "192.168.1.1" or "ap1" then the error is:
Error in connect() function
Could this be related to: aprock/react-native-tcp#7
With many IoT and smart devices the goal during setup is that the device and the phone talk directly to each other over the smart device's WiFi access point and that the phone's cellular interface is NOT used to resolve the smart device's IP address. Any idea how to get this working cross platform?
| Dependency | Version |
|---|---|
| iOS | latest on iPhone X device |
| react-native | 0.61.5 |
| react-native-tcp-socket | 3.0.5 |