User avatar
bensimmo
Posts: 5805
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 6:41 am

HermannSW wrote:
Wed Aug 25, 2021 9:29 am
...
P.P.S:
Only nasty here is that when one device connects to Wifi/Internet it kicks out any device connected before. Thanks to usb microsdcard reader data exchange between devices is no problem though:
viewtopic.php?f=29&t=315970
Set one Pi up as the main Pi and as a Router AP, have that one stay connected and all the others connect through that.

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 8:22 am

bensimmo wrote:
Thu Aug 26, 2021 6:41 am
HermannSW wrote:
Wed Aug 25, 2021 9:29 am
...
P.P.S:
Only nasty here is that when one device connects to Wifi/Internet it kicks out any device connected before. Thanks to usb microsdcard reader data exchange between devices is no problem though:
viewtopic.php?f=29&t=315970
Set one Pi up as the main Pi and as a Router AP, have that one stay connected and all the others connect through that.
Thanks, good idea -- but I don't have ethernet in my room, only Wifi. I think it is not possible to configure a Pi as wireless AP and have that Pi connect to internet over Wifi at the same time -- am I wrong?
(same as with my smartphone, in wifi tethering mode the smartphone cannot access internet via Wifi, only via phone data line)

P.S:
I could connect Pi0[W] and Pi4B in gadget mode to the Pi400 -- that way they could use Pi400 internet connectivity over USB.
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

alphanumeric
Posts: 3155
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 8:25 am

HermannSW wrote:
Thu Aug 26, 2021 8:22 am
bensimmo wrote:
Thu Aug 26, 2021 6:41 am
HermannSW wrote:
Wed Aug 25, 2021 9:29 am
...
P.P.S:
Only nasty here is that when one device connects to Wifi/Internet it kicks out any device connected before. Thanks to usb microsdcard reader data exchange between devices is no problem though:
viewtopic.php?f=29&t=315970
Set one Pi up as the main Pi and as a Router AP, have that one stay connected and all the others connect through that.
Thanks, good idea -- but I don't have ethernet in my room, only Wifi. I think it is not possible to configure a Pi as wireless AP and have that Pi connect to internet over Wifi at the same time -- am I wrong?
(same as with my smartphone, in wifi tethering mode the smartphone cannot access internet via Wifi, only via phone data line)

P.S:
I could connect Pi0[W] and Pi4B in gadget mode to the Pi400 -- that way they could use Pi400 internet connectivity over USB.
Add a second WIFI dongle to the AP Pi maybe? One does the AP stuff and the other connects to the Internet?

cleverca22
Posts: 6984
Joined: Sat Aug 18, 2012 2:33 pm

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 8:40 am

HermannSW wrote:
Wed Aug 25, 2021 9:29 am
P.P.S:
Only nasty here is that when one device connects to Wifi/Internet it kicks out any device connected before. Thanks to usb microsdcard reader data exchange between devices is no problem though:
viewtopic.php?f=29&t=315970
ive delt with a hotel before, that did similar, but they had wired ethernet at the time
you had to pay $X per day, PER MAC

i just plugged in a bog-standard router, hit the clone mac button, and boom, the router is now stealing the remaining credit for a pc that already accepted charges
and the router is doing NAT, so they think its all one system

in your case, what i would probably do, is maybe ethernet the pi4 to the pi400 via direct ethernet
then you could connect pi0 and pi4 over wifi, either one can be the hostapd, and set it to bridged mode

then configure the pi400 to NAT its ethernet into its wifi

kinda complex, and connected in series, but no usb in play, and each can communicate as fast as it can

pi0->pi400 over usb could also work, but i feel usb would be slower then internal wifi, and more complex to setup?

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 12:01 pm

alphanumeric wrote:
Thu Aug 26, 2021 8:25 am
Add a second WIFI dongle to the AP Pi maybe? One does the AP stuff and the other connects to the Internet?
Good idea, but I don't have one here in physical rehab (one is always mounted on Pi2B of my LightStandPi).

cleverca22 wrote:
Thu Aug 26, 2021 8:40 am
ive delt with a hotel before, that did similar, but they had wired ethernet at the time
you had to pay $X per day, PER MAC

i just plugged in a bog-standard router, hit the clone mac button, and boom, the router is now stealing the remaining credit for a pc that already accepted charges
and the router is doing NAT, so they think its all one system
Nice trick.
in your case, what i would probably do, is maybe ethernet the pi4 to the pi400 via direct ethernet
then you could connect pi0 and pi4 over wifi, either one can be the hostapd, and set it to bridged mode

then configure the pi400 to NAT its ethernet into its wifi

kinda complex, and connected in series, but no usb in play, and each can communicate as fast as it can
No ethernet cable here either -- and the internet is not fast as well, so ethernet over USB is likely not to be a performance decrease (internet bandwidth is big enough to watch netflix with media edition chromium).
pi0->pi400 over usb could also work, but i feel usb would be slower then internal wifi, and more complex to setup?
Slower likely, but definitely easier to setup (append one line to config.txt, and append "modules-load=..." to cmdline.txt, I did that with USB microsd card reader plugged into Pi400):

Code: Select all

pi@raspberrypi0W:~ $ tail -1 /boot/config.txt 
dtoverlay=dwc2
pi@raspberrypi0W:~ $ cat /boot/cmdline.txt 
console=serial0,115200 console=tty1 root=PARTUUID=2d0d486a-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles modules-load=dwc2,g_ether
pi@raspberrypi0W:~ $ 

But something strange happened here that I never have experienced in past years with Pi0[W] in ethernet gadget mode -- the Pi0W is NOT in "/24" subnet of the Pi400 usb0 IP:

Code: Select all

pi@raspberrypi400:~/rpi $ ifconfig usb0 | grep netmask
        inet 169.254.59.41  netmask 255.255.0.0  broadcast 169.254.255.255
pi@raspberrypi400:~/rpi $ 

It took 43 minutes(!) for nmap to scan all IP mask "/16" IP addresses (I was out for an exercise, so no problem):

Code: Select all

pi@raspberrypi400:~/rpi $ time sudo nmap -sn 169.254.59.41/16
Starting Nmap 7.70 ( https://nmap.org ) at 2021-08-26 12:37 CEST
Nmap scan report for 169.254.59.41
Host is up.
Nmap scan report for 169.254.116.109
Host is up (-0.031s latency).
MAC Address: 6E:EA:12:37:CC:3E (Unknown)
Nmap done: 65536 IP addresses (2 hosts up) scanned in 2581.68 seconds

real	43m1.803s
user	5m38.501s
sys	0m23.863s
pi@raspberrypi400:~/rpi $ 

In case Pi4B in gadget mode shows same IP behavior, I will let it "espeak" its IP address on boot:
viewtopic.php?f=66&t=259366&p=1583682#p1583912
Audio:
https://www.youtube.com/watch?v=z3R0U77-cLY


(I brought Pi0W into gadget mode to avoid Pi400(Pi4B) issues with secondary memory interface (SMI) for drivng WS2812B leds -- if I apply the proposed workaround on Pi400 I will not "see" anything [disabling HDMI output])
https://iosoft.blog/2020/09/29/raspberr ... el-ws2812/


P.S:
Something is wrong because of the IP addresses, I can ssh into the Pi0W, but that cannot access the internet -- maybe because of the browser network login needed here?

Code: Select all

pi@raspberrypi0W:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 169.254.116.109 icmp_seq=1 Destination Host Unreachable
From 169.254.116.109 icmp_seq=2 Destination Host Unreachable
From 169.254.116.109 icmp_seq=3 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 101ms
pipe 4
pi@raspberrypi0W:~ $ 
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

cleverca22
Posts: 6984
Joined: Sat Aug 18, 2012 2:33 pm

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 1:14 pm

HermannSW wrote:
Thu Aug 26, 2021 12:01 pm
But something strange happened here that I never have experienced in past years with Pi0[W] in ethernet gadget mode -- the Pi0W is NOT in "/24" subnet of the Pi400 usb0 IP:
the 169.254 space is what happens when the dhcp client cant find a dhcp server
you can either setup a dhcp server, setup bridging, or just set static IP's

it might help to bridge all of the usb "NIC"'s (the pi4 and pi0) into a single interface
then run a dhcp server on that, with regular NAT to give them all internet access

and then all 3 systems can talk to each other over the private subnet

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 4:28 pm

cleverca22 wrote:
Thu Aug 26, 2021 1:14 pm
the 169.254 space is what happens when the dhcp client cant find a dhcp server
you can either setup a dhcp server, setup bridging, or just set static IP's
Thanks for that explanation.

Just learned that udev rules allow to do stuff when usb0 gets added, as well as removed.
No need to do something on removal of usb0 here, adding 1 line for Pi400 as well as gadget Pi0W does the trick:

Code: Select all

pi@raspberrypi400:~ $ tail -1 /etc/udev/rules.d/99-com.rules 
SUBSYSTEM=="net",ACTION=="add",KERNEL=="usb0",RUN+="/sbin/ifconfig usb0 192.168.97.1 netmask 255.255.255.0"
pi@raspberrypi400:~ $ 

Code: Select all

pi@raspberrypi0W:~ $ tail -1 /etc/udev/rules.d/99-com.rules
SUBSYSTEM=="net",ACTION=="add",KERNEL=="usb0",RUN+="/sbin/ifconfig usb0 192.168.97.2 netmask 255.255.255.0"
pi@raspberrypi0W:~ $ 

Only problem left is that "ping 8.8.8.8" from Pi0W still does not work ...
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

cleverca22
Posts: 6984
Joined: Sat Aug 18, 2012 2:33 pm

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 4:35 pm

HermannSW wrote:
Thu Aug 26, 2021 4:28 pm
Only problem left is that "ping 8.8.8.8" from Pi0W still does not work ...
first, you need to configure a machine as a gateway: ip route add via 1.2.3.4 dev eth0
that tells linux to use the mac addr of 1.2.3.4, instead of trying to lookup the mac on the LAN with ARP

second, you need to tell that gateway to actually forward packets, something like "echo 1 > /proc/sys/net/ipv4/ip_forward"

third, you need to configure iptables to perform NAT, so it all claims to be one ip: "iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o wan -j MASQUERADE"
that tells linux, to mutate the source ip of any packets, that are coming from a given subnet, and going out a given interface, and to claim the packets came from the current machine, and conntrack will keep track of that, and apply the reverse changes to any replies

there may be services to do some of those steps on raspi-os, but i'm not that familiar with how debian manages things

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 6:50 pm

cleverca22 wrote:
Thu Aug 26, 2021 4:35 pm
there may be services to do some of those steps on raspi-os, but i'm not that familiar with how debian manages things
Thanks, I found and followed thagrol's "USB Ethernet Gadget A Beginner's Guide":
viewtopic.php?f=91&t=306121&p=1851130#p1851130

Unique mac addresses as per 4.3.3:

Code: Select all

pi@raspberrypi0W:~ $ echo "..."`tail --bytes 98 /boot/cmdline.txt`
... modules-load=dwc2,g_ether g_ether.dev_addr=12:34:56:78:9a:bc g_ether.host_addr=16:23:45:78:9a:bc
pi@raspberrypi0W:~ $ 
4.4 Using The libcomposite Module And configfs:
Skipped.

5.2 Picking an IP Address Range:
For example, if your router uses 192.168.x.x, use 10.x.x.x for the USB link.
At home I would need to change 192.168.x.x for static usb0 addresses.
But not in pysical rehab hospital, since Wifi router is in 172.16.0.0 – 172.31.255.255 range:

Code: Select all

pi@raspberrypi400:~ $ ifconfig wlan0 | grep netmask
        inet 172.29.49.245  netmask 255.255.255.252  broadcast 172.29.49.247
pi@raspberrypi400:~ $ 

5.3 Configuring An IP Address:
Skipped -- see my previous posting on how the static ip addresses are configured using udev rules.

6. Troubleshooting
Completely skipped, no 2nd channel setup into Pi0W.

7.2.2 Routed Access:
I really like this ;-)
Advantages:
...
• The zero is not a full member of your network so devices on your network cannot access the zero.
Disadvantages:
• The zero is not a full member of your network so devices on your network cannot access the zero.

@cleverca22
I used commands from @thagrol's 7.2.2, no "first", same "second" and different "third" (I did change "eth0" to "wlan0" only). I had to install "netfilter-persistent" via apt.


Finally after rebooting everything, Pi0W still cannot access the internet (ping 8.8.8.8 does not work, nor ssh into my personal website [which does work from Pi400]). It is most likely that infrastructure here prevents internet access of Pi0W gadget through Pi400 somehow. Will test whether it works at home when back in 2.5 weeks.
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

cleverca22
Posts: 6984
Joined: Sat Aug 18, 2012 2:33 pm

Re: The Raspberry Pi 400 thread!

Thu Aug 26, 2021 11:49 pm

HermannSW wrote:
Thu Aug 26, 2021 6:50 pm
Finally after rebooting everything, Pi0W still cannot access the internet (ping 8.8.8.8 does not work, nor ssh into my personal website [which does work from Pi400]). It is most likely that infrastructure here prevents internet access of Pi0W gadget through Pi400 somehow. Will test whether it works at home when back in 2.5 weeks.
while the pi0 is trying to ping, run a tcpdump on the pi400's usb interface
does it see the ping packets?

then run a tcpdump on the pi400's wifi interface
is it forwarding the packets? did the source ip change? is a reply coming back?

then look back at the usb interface, is it relaying the reply? did the dest ip get changed back correctly?

User avatar
bensimmo
Posts: 5805
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 8:25 am

Sorry for giving you a different project to do :lol:
They can advise you better, looks like fun and faff all round :-)

My mobile phone (huawei) allows the WiFi connected to to be shared and still used as well. They call it Wi-Fi Bridge (under tethering and hotpots). We use it all the time when needed.
I guess not all phones can do that.

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 11:26 am

bensimmo wrote:
Fri Aug 27, 2021 8:25 am
My mobile phone (huawei) allows the WiFi connected to to be shared and still used as well. They call it Wi-Fi Bridge (under tethering and hotpots). We use it all the time when needed.
I guess not all phones can do that.
Correct, I have Samsung Galaxy A40, and when try to enable Mobile Hotspot, I get asked whether it is OK to disable Wifi -- without that mobile hotspot does not work.

cleverca22 wrote:
Thu Aug 26, 2021 11:49 pm
while the pi0 is trying to ping, run a tcpdump on the pi400's usb interface
does it see the ping packets?

then run a tcpdump on the pi400's wifi interface
is it forwarding the packets? did the source ip change? is a reply coming back?

then look back at the usb interface, is it relaying the reply? did the dest ip get changed back correctly?
Thanks for showing path of investigation.
From my dayjob I am used to use Wireshark, so I used that instead of tcpdump.

Immediately this identified the issue, Pi0W cannot resolve 8.8.8.8 and asks for it in broadcast for "ping 8.8.8.8". It asks for 192.168.7.1 (the Pi400) as wel with broadcast.
Differently Pi400 can easily ping 192.168.97.2 (the Pi0W):
unable_to_resolve.png
unable_to_resolve.png
unable_to_resolve.png (52.59 KiB) Viewed 3234 times
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

cleverca22
Posts: 6984
Joined: Sat Aug 18, 2012 2:33 pm

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 11:29 am

yep, thats because you skipped step 1

the pi0 does not know where the gateway is, so it cant route packets thru the gateway

you must run "ip route add via a.b.c.d dev usb0" on the pi0, with the ip of the pi400
the same ip as whatever subnet the pi0 is on

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 12:27 pm

Thanks, before executing the command you proposed I queried routes:

Code: Select all

pi@raspberrypi0W:~ $ ip route
default dev usb0 scope link src 169.254.40.73 metric 202 
169.254.0.0/16 dev usb0 scope link src 169.254.40.73 metric 202 
192.168.97.0/24 dev usb0 proto kernel scope link src 192.168.97.2 
pi@raspberrypi0W:~ $ 

Your command does not work (192.168.97.1 is Pi400 ip address in Pi0W subnet):

Code: Select all

pi@raspberrypi0W:~ $ ip route add via 192.168.97.1 dev usb0
Usage: ip route { list | flush } SELECTOR
       ip route save SELECTOR
       ip route restore
       ip route showdump
       ip route get [ ROUTE_GET_FLAGS ] ADDRESS
                            [ from ADDRESS iif STRING ]
                            [ oif STRING ] [ tos TOS ]
                            [ mark NUMBER ] [ vrf NAME ]
                            [ uid NUMBER ] [ ipproto PROTOCOL ]
                            [ sport NUMBER ] [ dport NUMBER ]
       ip route { add | del | change | append | replace } ROUTE
SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ]
            [ table TABLE_ID ] [ vrf NAME ] [ proto RTPROTO ]
            [ type TYPE ] [ scope SCOPE ]
ROUTE := NODE_SPEC [ INFO_SPEC ]
NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ]
             [ table TABLE_ID ] [ proto RTPROTO ]
             [ scope SCOPE ] [ metric METRIC ]
             [ ttl-propagate { enabled | disabled } ]
INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...
NH := [ encap ENCAPTYPE ENCAPHDR ] [ via [ FAMILY ] ADDRESS ]
	    [ dev STRING ] [ weight NUMBER ] NHFLAGS
FAMILY := [ inet | inet6 | ipx | dnet | mpls | bridge | link ]
OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ]
           [ rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ]
           [ window NUMBER ] [ cwnd NUMBER ] [ initcwnd NUMBER ]
           [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]
           [ rto_min TIME ] [ hoplimit NUMBER ] [ initrwnd NUMBER ]
           [ features FEATURES ] [ quickack BOOL ] [ congctl NAME ]
           [ pref PREF ] [ expires TIME ] [ fastopen_no_cookie BOOL ]
TYPE := { unicast | local | broadcast | multicast | throw |
          unreachable | prohibit | blackhole | nat }
TABLE_ID := [ local | main | default | all | NUMBER ]
SCOPE := [ host | link | global | NUMBER ]
NHFLAGS := [ onlink | pervasive ]
RTPROTO := [ kernel | boot | static | NUMBER ]
PREF := [ low | medium | high ]
TIME := NUMBER[s|ms]
BOOL := [1|0]
FEATURES := ecn
ENCAPTYPE := [ mpls | ip | ip6 | seg6 | seg6local ]
ENCAPHDR := [ MPLSLABEL | SEG6HDR ]
SEG6HDR := [ mode SEGMODE ] segs ADDR1,ADDRi,ADDRn [hmac HMACKEYID] [cleanup]
SEGMODE := [ encap | inline ]
ROUTE_GET_FLAGS := [ fibmatch ]
pi@raspberrypi0W:~ $ 

Same error message when command is prefixed with "sudo". What is wrong in the command? NODE_SPEC?
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

cleverca22
Posts: 6984
Joined: Sat Aug 18, 2012 2:33 pm

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 12:49 pm

ahh, the command has gotten a bit more strict since i last used it

its now "ip route add default via 1.2.3.4 dev usb0"
you may also want to use change instead, to get rid of the 169 default

or setup a dhcp server, that tells the pi0 what ip and gateway to use, then the pi0 configures itself

Diggio
Posts: 2
Joined: Fri Aug 27, 2021 4:09 pm

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 4:35 pm

Hello guys,
I have a Raspberry PI 400 64 bit, 4 GB, which until yesterday I had connected with a Samsung TV (UE40B6000VWXXC Full Hd) via HDMI port. Everything worked beautifully. I bought a new samsung tv (UE43AU8070 4K), connected in the same way, but the sound doesn't work. The port used in the Raspberry is the hdmi 0 (near the power socket), and the same hdmi 0 still works, because I tried it on another monitor, and the audio is ok.
I tried to edit the "config.txt" sudo nano /boot/config.txt file with these lines: "hdmi_drive = 2" instead of "# hdmi_drive = 2", as read in a previous post on this forum, but it doesn't work.
Can someone help me.
Thanks in advance,

Massimo

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 6:41 pm

I tried, this is situation before executing the command:

Code: Select all

pi@raspberrypi0W:~ $ ip route
default dev usb0 scope link src 169.254.40.73 metric 202 
169.254.0.0/16 dev usb0 scope link src 169.254.40.73 metric 202 
192.168.97.0/24 dev usb0 proto kernel scope link src 192.168.97.2 
pi@raspberrypi0W:~ $

The command was not allowed, so I prefixed with sudo and even then got error when trying change (and "ip route" output did not change):

Code: Select all

pi@raspberrypi0W:~ $ ip route change default via 192.168.97.1 dev usb0
RTNETLINK answers: Operation not permitted
pi@raspberrypi0W:~ $ sudo ip route change default via 192.168.97.1 dev usb0
RTNETLINK answers: No such file or directory
pi@raspberrypi0W:~ $

Next I tried with "add" instead, without "sudo" did not work either:

Code: Select all

pi@raspberrypi0W:~ $ ip route add default via 192.168.97.1 dev usb0
RTNETLINK answers: Operation not permitted
pi@raspberrypi0W:~ $

Now with "sudo" new default route gets added:

Code: Select all

pi@raspberrypi0W:~ $ sudo ip route add default via 192.168.97.1 dev usb0
pi@raspberrypi0W:~ $ ip route
default via 192.168.97.1 dev usb0 
default dev usb0 scope link src 169.254.40.73 metric 202 
169.254.0.0/16 dev usb0 scope link src 169.254.40.73 metric 202 
192.168.97.0/24 dev usb0 proto kernel scope link src 192.168.97.2 
pi@raspberrypi0W:~ $

Unfortunately "ping 8.8.8.8" still does not work, just hangs:

Code: Select all

pi@raspberrypi0W:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

So I took packet capture with wireshark capturing usb0 traffic on Pi400 (192.168.97.1) from Pi0W (192.168.97.2), and a ping request can be seen!
icmp_requests.png
icmp_requests.png
icmp_requests.png (54.98 KiB) Viewed 3139 times

So now config on Pi400 seems not correct either ... will investigate following the steps you proposed.
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 6:58 pm

My guess was that IP masquerading does not work, and so I did execute that command on Pi400 again:

Code: Select all

pi@raspberrypi400:~/Documents $ cat  /etc/sysctl.d/routing.conf
net.ipv4.ip_forward=1
pi@raspberrypi400:~/Documents $ sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
pi@raspberrypi400:~/Documents $ 

Now ping on Pi0W works as expected:

Code: Select all

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=112 time=20.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=112 time=21.0 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 2ms
rtt min/avg/max/mdev = 20.521/20.764/21.008/0.282 ms
pi@raspberrypi0W:~ $ 

Even ssh from Pi0W into my personal website (stamm-wilbrandt.de) works:

Code: Select all

pi@raspberrypi0W:~ $ ssh foobar@stamm-wilbrandt.de
foobar@stamm-wilbrandt.de's password: 
-chrootsh-4.2$ 
-chrootsh-4.2$ cat httpdocs/index.html 
<html xmlns="http://www.w3.org/1999/xhtml">    
 <head>      
   <title>redirect to English homepage</title>      
   <meta http-equiv="refresh" content="0;URL='en'" />    
  </head>    
  <body> 
    <p>This page is shortcut for <a href="en">English homepage</a>.
  </body>  
</html> 

Thanks for all the help to get this working!


P.S:
I love the 1+16+64=81GB binary data for peg solitaire on my website -- you can play the game (explantion on homepage)
https://stamm-wilbrandt.de/en/xsl-list/peg-solitaire/
and get indication whether solution from any current position you have is possible or not ...

Code: Select all

-chrootsh-4.2$ du httpdocs/peg/* | grep -v sol
67109344	httpdocs/peg/3-3-2-2
1048584	httpdocs/peg/English
16777356	httpdocs/peg/French
-chrootsh-4.2$ 
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Fri Aug 27, 2021 8:18 pm

To complete the networking stuff, I executed "who" command on my personal website ssh session to find out which IP address that site sees (not Pi0W and not Pi400 for sure):

Code: Select all

-chrootsh-4.2$ who
foobar pts/0        2021-08-27 22:02 (62.55.250.202)
-chrootsh-4.2$ 

I did geo location for that IP address:
https://www.iplocation.net/ip-lookup

5 hits, farthest away 483km north is Hamburg, farthest away south east is Munich with 220km, and there is one hit for the town (Bad Rappenau).

"nslookup" reveils the domain for that IP address, and dropping "hotspot." lands on correct website for this location:

Code: Select all

pi@raspberrypi400:~ $ nslookup 62.55.250.202
202.250.55.62.in-addr.arpa	name = hotspot.kur-br.de.

pi@raspberrypi400:~ $ 

P.S:
I posted a summary of all steps needed here:
viewtopic.php?f=91&t=306121&p=1906876#p1906876
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Wed Sep 01, 2021 8:43 pm

I created a picamera fork with interesting mission statement:
Remove the need for picamera, as well as connected Raspberry camera, for creating HDMI overlays (like the camera preview window on layer 2).
Today I was successful, removed camera.py and 7 other modules from the repo, and still can do HDMI overlay. After that I synced the repo to my Pi400 and it works there (now) as well. Allows me to continue working on HDMI overlays on the Pi400:
viewtopic.php?f=32&t=318845&p=1908585#p1908543
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread! [Wifi repeater]

Fri Sep 10, 2021 1:51 pm

Where I am there is no ethernet, and only one device can connect to internet with my login. Therefore I wanted to setup a Wifi repeater.

Pi400 internal Wifi does not allow for "Internet sharing from the same WiFi interface" (there are adapters that can).

Via amazon prime I did buy 5.77$ Realtek USB3 RTL8812AU adapter (0bda:b812 with lsusb) and learned that it has no Linux kernel mainline support, and learned how to build kernel driver for it in addition:
viewtopic.php?f=36&t=319296
20210909_092153.part.10%.jpg
20210909_092153.part.10%.jpg
20210909_092153.part.10%.jpg (32.98 KiB) Viewed 2747 times

Today I got working Pi400 wifi repeater setup and described the needed steps (based on "create_ap" github repo, I tried Raspberry official documentation on how to setup wireless access point and modify that to be wireless repeater -- bad idea, did not work and was hard to undo):
viewtopic.php?f=36&t=319296#p1911750


The two nearest Wifi routers to access to here are behind three walls each. The USB Wifi with its external antenna can better deal with the 3 walls (testmy.net download speed on Pi400 is 26.5Mbps, still 14.6Mbps on Pi4B connected to Pi400), so I made wlan1 connect to internet and wlan0 (Pi400 internal wifi) the wireless repeater:
Image


P.S:
Using one USB port for trackball dongle and another for USB wifi is no problem, I do have mini USB3 three port hub if needed:
https://www.amazon.de/gp/product/B08MQH ... le_o07_s00
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

aBUGSworstnightmare
Posts: 6438
Joined: Tue Jun 30, 2015 1:35 pm

Re: The Raspberry Pi 400 thread!

Fri Sep 10, 2021 7:18 pm

A cheap Bluetooth mouse (once bought some HP's at Saturn for less than 9bucks) will let you get rid of the Logitech unified receiver, freeing one USB port.

User avatar
HermannSW
Posts: 5579
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: The Raspberry Pi 400 thread!

Fri Sep 10, 2021 8:16 pm

aBUGSworstnightmare wrote:
Fri Sep 10, 2021 7:18 pm
A cheap Bluetooth mouse (once bought some HP's at Saturn for less than 9bucks) will let you get rid of the Logitech unified receiver, freeing one USB port.
That is true, and would definitely be an option at times where I used original Raspberry mouse with the Pi400.
But since I bought Logitech MX Ergo trackball (more expensive than plain Pi400!) I use that with all computers.
Trackball is unbeatable when sitting in armchair without desk, or lying in bed (trackball has seen 2 hospitals already):
viewtopic.php?f=140&t=289934&p=1882208& ... l#p1882208
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/Raspberry_camera.html
https://stamm-wilbrandt.de/

sumnerc102
Posts: 1
Joined: Fri Sep 10, 2021 9:44 pm

Re: The Raspberry Pi 400 thread!

Fri Sep 10, 2021 9:53 pm

Hi everyone, I have just purchased a Raspberry pi 400 and I am looking for mechanical drawings or even an STL model of the Raspberry Pi 400 Case design.

I have looked on the official page at all the mechanical drawings but no luck, I want to 3d print a case that would sit to the left and house a SSD but not look out of place so I want to replicate the same angled pitch of the keyboard and the same curved corners, I found a line drawing looking at the back IO but that's it really.

I was thinking about how it would be like the tape drives that sat alongside the Commodore 64 that i owned when I was a kid :)

Joop99
Posts: 122
Joined: Fri Jul 23, 2021 1:23 pm

Re: The Raspberry Pi 400 thread!

Sat Sep 11, 2021 3:33 pm

sumnerc102 wrote:
Fri Sep 10, 2021 9:53 pm
Hi everyone, I have just purchased a Raspberry pi 400 and I am looking for mechanical drawings or even an STL model of the Raspberry Pi 400 Case design.

I have looked on the official page at all the mechanical drawings but no luck, I want to 3d print a case that would sit to the left and house a SSD but not look out of place so I want to replicate the same angled pitch of the keyboard and the same curved corners, I found a line drawing looking at the back IO but that's it really.

I was thinking about how it would be like the tape drives that sat alongside the Commodore 64 that i owned when I was a kid :)
I'm not sure what you want, but the back of the bottom case of the Pi is now on an angle and that could be made strait if you want 3d print clone. If you do that you get room for a small ssd drive, but don't be optimistic, you still have to connect it to an USB port, there is nothing else available, unless you know your stuff and connect some other ic setup to the pi. So the only win in this setup is that you don't connect a ssd drive on the external USB port as a separate item. But that's about it.

Return to “Raspberry Pi 400”