You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在同一WiFi网络下从树莓派Zero W访问树莓派3的网页

Accessing Raspberry Pi 3's Web Pages from Pi Zero W

Hey David, let's troubleshoot this step by step—since both devices are on the same SAMBA WiFi network, getting this working should be manageable once we rule out common roadblocks. Here's what to check and try:

1. Verify Basic Network Connectivity First

Before diving into web server issues, confirm the two Pis can talk to each other:

  • On your Pi Zero W, open a terminal and run:
    ping 192.168.43.39
    
  • If you see successful replies (like 64 bytes from 192.168.43.39: icmp_seq=1 ttl=64 time=2.3ms), your network connection is solid. If not:
    • Double-check both devices are connected to the SAMBA WiFi network (not different networks with the same name).
    • Confirm the Pi 3's IP is still 192.168.43.39 (run hostname -I on the Pi 3 to verify).

2. Ensure the Pi 3's Web Server is Listening for External Connections

Web servers sometimes default to only listening on the local loopback (127.0.0.1), which blocks access from other devices. To check:

  • On the Pi 3, run this command to see which ports your web server is using (replace 80 with your custom port if you changed it):
    netstat -tulpn | grep :80
    
  • Look for a line that includes 0.0.0.0:80 or 192.168.43.39:80—this means the server is accepting connections from all interfaces. If you only see 127.0.0.1:80:
    • For Apache: Edit the 000-default.conf file (usually in /etc/apache2/sites-available/) and change Listen 127.0.0.1:80 to Listen 80, then restart Apache with sudo systemctl restart apache2.
    • For Nginx: Edit your server block config and set listen 80; instead of listen 127.0.0.1:80;, then restart Nginx with sudo systemctl restart nginx.

3. Directly Access the Pi 3's Web Pages

Once connectivity and server settings are confirmed, access the pages from your Pi Zero W:

  • Open a web browser (like Midori or Chromium) and navigate to:
    • Pi 3's index page: http://192.168.43.39
    • Pi 3's camera page: http://192.168.43.39/camera.html
  • If you don't want to use the IP, you can also use the Pi 3's hostname (default is raspberrypi)—try http://raspberrypi.local or http://raspberrypi (some networks support hostname resolution without .local).

4. Check for Firewall Blocks

Raspberry Pi OS doesn't enable a firewall by default, but if you installed ufw or another firewall tool on the Pi 3, it might be blocking port 80:

  • On the Pi 3, allow HTTP traffic with:
    sudo ufw allow 80/tcp
    
  • Or temporarily disable the firewall to test:
    sudo ufw disable
    

5. Test with a Command-Line Tool (Bypass Browser Issues)

If the browser isn't working, use curl on the Pi Zero W to rule out browser-specific problems:

curl http://192.168.43.39/camera.html

If you see the HTML content of the page printed in the terminal, the server is working—your browser might have cache issues or need a settings tweak.


内容的提问来源于stack exchange,提问作者David Mathias

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:50:46