This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wifi problem with Tinypilot
#11
I don't have a good grasp of network issues, but I'm a bit lost here.
After my tests yesterday, I restarted TinyPilot, so logically it must have lost what I ran on the command line? I expected not to be able to access it from the OpenPlotter AP, but I can access it with its fixed IP address 10.10.10.2
And Pypilot manages to reach OpenPlotter as well.

The route -n command shows one more line than yesterday:
Code:
tc@pypilot:/$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 wlan0
127.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 lo
192.168.14.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan1
192.168.14.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan1


So I don't really understand...
Is there things persisted between reboots, regarding networking, apart from the /.pypiot/networking.txt configuration file?
Reply
#12
Hi Sean,

I added the following lines to /.pypilot/networking.sh:
Code:
client_netmask=255.255.255.0
client_gateway=10.10.10.1

I modified networking.sh to take these new parameters into account and saved it with filetool.sh -b
=> See attached file and look for comments "added by Marine".

The modifications made allow to define the netmask and add a default route via the gateway.
But there is still a problem that I do not understand: the route added for the gateway disappears after a very short time (of the order of a second or less). I did different tests, it seems to be a question of delay, and not a question of a command executed later in the script. As if something was running in the background and came to delete it.
I observe it by manually executing the networking.sh script. If I add the route immediately after the script (see test below), it does not hold. But if I wait 1 second after the script ends, and add the route again, then it holds.

Also the network settings web page should be modified  Wink


Code:
tc@pypilot:/opt$ sudo ./networking.sh ; route -n ;  sudo route add default gw 10.10.10.1 ;  route -n
stop services
wlan1    Link encap:Ethernet  HWaddr B8:27:EB:07:79:07 
          inet addr:192.168.14.1  Bcast:192.168.14.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe07:7907/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:3702 (3.6 KiB)
iw is already installed!
ifconfig set client address!
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
0.0.0.0        10.10.10.1      0.0.0.0        UG   0      0        0 wlan0
10.10.10.0      0.0.0.0        255.255.255.0  U    0      0        0 wlan0
127.0.0.1       0.0.0.0        255.255.255.255 UH  0      0        0 lo
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
start hostapd
Sun Feb 11 11:17:27 UTC 2024
hostapd is already installed!
Sun Feb 11 11:17:28 UTC 2024
start dnsmasq
dnsmasq is already installed!
route: SIOCADDRT: File exists
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
10.10.10.0      0.0.0.0        255.255.255.0  U    0      0        0 wlan0
127.0.0.1       0.0.0.0        255.255.255.255 UH  0      0        0 lo
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
0.0.0.0        10.10.10.1      0.0.0.0        UG   0      0        0 wlan0
10.10.10.0      0.0.0.0        255.255.255.0  U    0      0        0 wlan0
127.0.0.1       0.0.0.0        255.255.255.255 UH  0      0        0 lo
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
tc@pypilot:/opt$ route -n
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
10.10.10.0      0.0.0.0        255.255.255.0  U    0      0        0 wlan0
127.0.0.1       0.0.0.0        255.255.255.255 UH  0      0        0 lo
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1
192.168.14.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan1


Attached Files
.txt   networking.sh.txt (Size: 4.17 KB / Downloads: 36)
Reply
#13
Just with the netmask part, it already seems to work correctly for local exchanges. So maybe you could already integrate this part into your Git repository ?

The fact that the gateway is not defined prevents Pypilot from accessing the Internet via the OpenPlotter AP, for example. But it is already less common as a use!

Code:
tc@pypilot:~$ ping www.google.com
ping: bad address 'www.google.com'
tc@pypilot:~$ sudo route add default gw  10.10.10.1
tc@pypilot:~$ ping www.google.com
PING www.google.com (172.217.20.196): 56 data bytes
64 bytes from 172.217.20.196: seq=0 ttl=114 time=19.377 ms
64 bytes from 172.217.20.196: seq=1 ttl=114 time=14.532 ms
Reply
#14
One last really twisted point that I just realized:
If TinyPilot is connected as a client to the OpenPlotter AP
And if OpenPlotter is connected as a client to another AP (Internet box in my case)
And if this other AP (Internet box) is running on a Wifi channel other than 6, then OpenPlotter can connect to the AP, but Pypilot can't connect to the OpenPlotter AP !
I think that the Wifi channel used by the OpenPlotter AP aligns with the Wifi channel that is imposed on it as a client. Even though the OpenPlotter /etc/hostapd/hostapd.conf file has a "channel=6" parameter

I think this is actually the problem I've been facing since the beginning, and that took me so long to understand. Hope this can help others...
Reply
#15
so if they are all on channel 6 it works ok?

need to make the ap+client mode set the ap channel to the same channel as the client, that would probably help right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)