-
Notifications
You must be signed in to change notification settings - Fork 13
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
Connection problems: mismatch between local ip address and shield's ip address using WiFi direct #30
Comments
@rivasd Thanks for sharing and investigating! Also, thanks for sharing such detailed information. You are a model community member! When issues like this get resolved, everyone benefits. |
@retiutut Thank you :) happy to help. Looking quickly, I can see We are currently heading into a data collection phase and I do not have the time to re structure the node driver for WiFi in this way. I will stick to my hardcoded patch, but I hope my notes will help you implement the long term fix! |
I think the idea of a hardcoded fix is the best way to go right now. Just to clarify:
|
I made changes inside the But I am happy to say that once I got through all that I simply switched the order of the if clauses on line https://github.com/OpenBCI/OpenBCI_NodeJS_Wifi/blob/d4583cd5b99dde9427f35da07b25523e47286e1e/openBCIWifi.js#L422 So that WiFi interfaces are selected by default. To be fair, this should be the default since WiFi direct is recommended in the official docs... ;) Ah also, this all started with me trying to confirm the impedance checks still did not work even through the GUI. I can now confidently say that they don't, and that definitely points to firmware issues between the shield and the cyton. This low-level stuff, I reaaaaally cannot help you with! |
This info is enough for now, and Hub+WiFi is low priority. It's great to have a trail of breadcrumbs for everyone. There is enough info here in this thread to start working on a fix at another time. Thanks! |
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 is192.168.4.2
. However, the current nodejs implementation assumes that the local ip address must be the one assigned throughEthernet
, 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
insideWifi.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:Wifi.prototype.getLocalIPAddress
to 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
The text was updated successfully, but these errors were encountered: