-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hi!
I was investigating connection issues related to our WiFi shield as can be seen on my forum post and finally narrowed it down to a very similar issue as #26.
We operate in a corporate setting where every machine has multiple network interfaces, the main one being an Ethernet connection that is heavily secured and through which any OpenBCI data transmission is hopeless. We thus opted for WiFi direct through a usb wifi antenna. When connecting the shield's network through this interface, we can see its ip address as 192.168.4.1, and our computer's is 192.168.4.2. However, the current nodejs implementation assumes that the local ip address must be the one assigned through Ethernet, which in our case is a completely different address assigned starting with different numbers. As i long suspected, this is the source of our connection problems, as sockets between ip addresses of the shield's interface and our coporate addresses simply do not work.
Hardcoding 192.168.4.2 inside Wifi.prototype.getLocalIPAddress solved the connection problem and I was able to see data streaming in the GUI for the first time, confirming this mismatch was definitely the issue.
As I can see, the current solution, implemented when solving #26, was based on @retiutut having the reverse problem, and thus Wifi.prototype.getLocalIPAddress was hardcoded to use the address from the Ethernet interface. A more robust solution could either:
- Let the user specify directly the local ip address to use (would require a GUI update, maybe a second text input underneath the STATIC IP choice for the shield)
- change the implementation of
Wifi.prototype.getLocalIPAddressto dynamically return an ip address that is "compatible" with the shield's address. This could be done by checking that both start with the same numbers in the first 2 "fields" of the ip, but there is probably a non-hacky way to do that with node APIs (I'm really not good at networking stuff)
I will try to submit a PR regarding this, I think it would help adoption of the shield in more complex networking environments.
Hub version: 2.1.0
GUI version: 4.1.6
Shield firmware: 2.0.5