-1

I have set up a headless raspberry pi zero W to allow SSH via a USB connection. I now want to be able to host for example syncthing on the pi.

Under which IP address should this be accessible?

The initial set up is based on this post and works well allowing me to access SSH via USB. My set up steps are:

  • Add: dtoverlay=dwc2 to boot/config.txt`

  • Add: modules-load=dwc2,g_ether to boot/cmdline.txt after rootwait

  • Add the following two lines to rootfs/etc/dhcpcd.conf:

    interface usb0

    static ip_address=192.168.5.1/24

The machine I am using to connect to the pi is running Ubuntu 20.04.2 LTS. After setting the IPv4 to manual with the address 192.168.5.2 and netmask 255.255.255.0 the raspberry pi is accessible using ssh [email protected] I have no problem suing the SSH.

Then I installed syncthing and started it up which should run on port :8384 but if I try and access the GUI in the web browser at http://192.168.5.1:8384 it times out.

How can I find out where under which IP the syncthing server (or any other) should be running?

Thanks every one for helping me out!

5
  • Not sure what you mean by After setting the IPv4 to manual How does your host know about the 192.168.5.x network? Can you ping the Pi or ssh to it? On the Mac you have to have a RNDIS network entry and set an IP address on this before it will recognise a USB connected Pi - I think the PC needs the same. Commented Apr 21, 2021 at 10:21
  • Sorry I missed a crucial fact am using a Ubuntu machine to connect to the pi. And that works perfectly well I can SHH into it at the defined IP without any problems. Commented Apr 21, 2021 at 10:27
  • It is unclear what you have actually done or what you are asking, but if you want to know what your Pi is doing post the output of ip a; ip r Commented Apr 21, 2021 at 11:23
  • Assuming you have no firewall running on the zero my guess then is that the job has not started correctly if you can ssh in to it - if you have a desktop on the zero try using 127.0.0.1:8384 in a browser else try curl "http://127.0.0.1:8384" and see if you get anything back other than refused... Commented Apr 21, 2021 at 11:55
  • Thanks @Andrew curl did return an output the issue was that the host machine was running another instance on the same port. After forwarding the port of the raspberry pi to an unused port it works! Thanks a lot for the tip! Commented Apr 21, 2021 at 13:40

1 Answer 1

0

The host machine was using the same port which was the reason why it did not work. The suggestion by Andrew to use curl "http://127.0.0.1:8384" returned output just fine on the raspberry pi.

The solution was to start an ssh instance and forward the port like this:

ssh -L 8000:localhost:8384 [email protected] 

This made the syncthing instance accessible at port 8000 without any conflict from the host machine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.