Skip to content
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

Add Ethernet settings on http://192.168.10.1/#/settings #605

Open
pasniak opened this issue May 25, 2017 · 17 comments
Open

Add Ethernet settings on http://192.168.10.1/#/settings #605

pasniak opened this issue May 25, 2017 · 17 comments

Comments

@pasniak
Copy link

pasniak commented May 25, 2017

When I plug Ethernet cable I cannot see Stratux on my network. It would be great to have it accessible from desktop for debugging or log viewing.

@cyoung
Copy link
Owner

cyoung commented May 25, 2017

ifup eth0 from the Wi-Fi connection.

@pasniak
Copy link
Author

pasniak commented May 25, 2017

Where is the file? Yes, I'm familiar with Linux but each time I get to look at Pi's settings, network config is a different file, which looks somewhat cryptic.... + I'd have to do it every time I get a new Stratux img.... +If I f.up I'd have to reinstall img (it's a headless setup)...

@cyoung
Copy link
Owner

cyoung commented May 25, 2017

/etc/network/interfaces

@pasniak
Copy link
Author

pasniak commented May 26, 2017

I added ifup eth0 to /etc/network/interfaces
in the second (empty) line (before something with eth0 already)
Now, I do not see the ip on my desktop nor I can bring up WiFi (Edimax is not even blinking).

@pasniak
Copy link
Author

pasniak commented May 26, 2017

I had to ssh into stratux and execute sudo ifup eth0.
If it is that simple why not add it to the gui? (when we can already run update shell from there...)

@peepsnet
Copy link
Contributor

peepsnet commented May 26, 2017 via email

@pasniak
Copy link
Author

pasniak commented May 26, 2017

I meant adding this in http://192.168.10.1/#/settings: https://i.imgur.com/QRsdvQV.png

@pasniak pasniak changed the title Add Ethernet settings Add Ethernet settings on http://192.168.10.1/#/settings May 26, 2017
@ssokol
Copy link
Collaborator

ssokol commented May 26, 2017 via email

@peepsnet
Copy link
Contributor

peepsnet commented May 26, 2017

@ssokol,
The Idea of that is great but, I believe, there are too many variables in play.

  • Wireless client mode (system attempts to join an existing wireless
    network, falls back to AP mode if connection fails

This, in theory, sounds easy but...

  1. If you connect to an existing network then by default you are not able to get data from 192.168.10.1. You would have to then set the "Static IPs" under "Developer Options" in "Settings".
    The solution I have gone with is adding an EDIMAX dongle and modifying the appropriate files.
    See: https://github.com/cyoung/stratux/blob/master/image/interfaces#L13-L55

Wireless Security (enable WPA2 password on the AP)

  1. See: 575d51c

  2. I can try this again to see if I can get it to work again...

  • Manual IP destinations for GDL-90 streams

This exists in Settings->Developers Options-> Static IP's

  • Ethernet port automatically starts up with DHCP client

These all seem like Developer Options. If you want to help develop then I believe you might need the knowledge on how to do these things

  • Ethernet port starts up with static IP

Seems like the users DHCP server can take care of this. Assign IP by MAC address. This is what I do.

  • Ethernet port starts up with static IP and DHCP server

Again this seems like DEV stuff. Are there really users plugging their Stratux into a router in the aircraft and allowing all on board to watch the Status page in flight?? Seems to me like this is a custom application that can be accomplished with a WAP and is not up to us to do this.

Just my thoughts.

Also as a note to the processes of the first request.
Workflow as I see it.

  1. When the RPI boots and wlan0 in started the interface is brought up and then stratux-wifi.sh is started(see: https://github.com/cyoung/stratux/blob/master/image/interfaces#L11)

  2. This takes the settings we set in dhcpd.conf, isc-dhcp-server, and interfaces and apply the hostapd file to them.

It seems like the current process would have to change before bringing up the wlan0.

I guess I could write a script that looks at the Stratux Config file and see if the user wants to connect to a specified AP(imagine: apName=MyPlanesWiFi). If so then move files around to use the appropriate required settings.

It would require rewriting the interfaces and wpa_supplicant.conf on the fly with every boot.

Just a quick bunch of thoughts for the process. Not FUN! But Possible... I wouldn't shy away from the challenge if there is enough need and someone to build the web interface and modify the associated.GO files as needed.

Don

@pasniak
Copy link
Author

pasniak commented May 26, 2017

Yesterday, just executed sudo ifup eth0, wouldn't it be sufficient if this was executed from web server?

When I run it I got both WiFi (Edimax blue light blinking) and Ethernet working. Just trying to go for low hanging fruit here... It's not about anything in aircraft but debugging or even getting logs off, which is much more convenient from desktops, typically plugged into routers.

@cyoung
Copy link
Owner

cyoung commented May 26, 2017

Throw it in /etc/rc.local (before the last line) so it does it every time. It doesn't matter if you have ethernet plugged in or not. Not sure what I changed but it should come up automatically. Try either that or systemctl enable dhcpcd and see if it comes up on ethernet every time you reboot.

@peepsnet
Copy link
Contributor

I use an app like this on my Android tablet to create a few commands I use regularly
https://play.google.com/store/apps/details?id=crosien.HotButton

Like "sudo shutdown -h now"

You could do this for the ifup also!!

@D35Bonanza
Copy link

D35Bonanza commented Jun 6, 2017

You can get the stratux webpage on both wlan0 and eth0 when active. No issue.
In developer mode I use static IP to send the gdl90 UDP packets They are still sent to wlan0 DHCP clients. 192.168.10.* is wlan0 192.168.3.* is eth0 both wlan0 and eth0 have udp connections from the stratux software.
root@raspberrypi:~# netstat -u

Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State

udp 0 0 raspberrypi:45833 192.168.3.109:4000 ESTABLISHED

udp 0 0 raspberrypi:43397 192.168.3.110:4000 ESTABLISHED

udp 0 0 raspberrypi:41359 192.168.3.104:4000 ESTABLISHED

udp 0 0 raspberrypi:50143 192.168.10.10:4000 ESTABLISHED

udp 0 0 raspberrypi:43519 192.168.10.11:4000 ESTABLISHED

root@raspberrypi:~#

add entry /etc/network/interfaces
allow-hotplug eth0 //interface is active on boot.
before
iface eth0 inet dhcp //my setting

ifup eth0 no longer required.
interfaces
auto lo
#br0

iface lo inet loopback

#eth0
allow-hotplug eth0

iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet static
address 192.168.10.1
netmask 255.255.255.0
post-up /usr/sbin/stratux-wifi.sh

see man interfaces

@bradanlane
Copy link
Contributor

bradanlane commented Jul 5, 2017

Alternate Option:

It's possible to have a Raspberry Pi configured to automatically switch its WiFi between access point and client mode.

This would still require exposing some admin UI for the purposes of the user entering one or more of their SSID networks.

Once setup, it would be automatic and it would also mean not having to expose the ethernet port thru the case/housing or using a wired connection.

@jocamero
Copy link

jocamero commented Feb 4, 2019

@cyoung Any progress on this? Or is there a tutorial out there somewhere where I can figure out how to modify the network settings so the Stratux connects to my iPad's Personal Hotspot? This way the iPad would have cellular Internet while on the ground and the Stratux would be able to get software updates without opening the case to expose the Ethernet port.

I think my preference would be on the following order to connect to iPad's Personal Hotspot, home network SSID, and if neither of those are available, then revert to the default AP mode offering up the Stratux network SSID. Possible?

@wa9als
Copy link

wa9als commented Feb 4, 2019 via email

@HoeckDK
Copy link

HoeckDK commented Aug 10, 2022

Hi all,

I'm looking for the eth0 DHCP server+static IP.
My use case is that I have run out of serial in my Open Vario and would like to avoid using wifi. Therefore if the LAN port would act as the WLAN does, it would be sweet, and provide the vario with an IP.

I have tried to modify /etc/network/interfaces, but changes seems to be reverted on next reboot. And I never manage to get an IP other that 127.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants