Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



SSH to RPI Zero W O...
 
Share:
Notifications
Clear all

[Solved] SSH to RPI Zero W Over Wifi Times Out

10 Posts
3 Users
1 Reactions
3,876 Views
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter  

I am setting up my rpi zero w headless. I have correctly (I believe)  created an appropriate wpa_suppliment.conf file using notepad ++ and ensured that the file was in a UNIX format. I also created an empty file named "ssh" using the following command on windows: type nul > ssh and moved it to the root of the D: drive which is where the ssd card is mounted. I put the newly configured ssd to the  pi zero and booted it for the first time. Now I am able to see the device's ip address and I am able to both ping it and tracert to it from my windows 10 PC command line.

But when I try to ssh to the pi, from the command line or using Putty, I get a connection timed out error, which is quite puzzling to me. On the surface, things seem to be OK.

One thing I found odd was that the pi zero has a completely different IP address than my LAN. The PI's address is 23.195.69.111. My LAN is 192.168.xx. I'm not sure that is a problem, I just assumed my router would assign the devices IP. Hmmmm.

 

I have run out of troubleshooting ideas and could use some help!

 

Thanks

Bill


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Hi Bill,

Your Pi's IP address appears to be a public IP address (see here)?
This doesn't seem to be correct unless you're somehow directly connected to the Internet?

Anyhow, this will probably not be the reason why you cannot SSH into your Pi - it is however something to look into.
Unless something in your Pi is blocking non-local LAN IP addresses.

I'd check first why the IP Address is a public IP address ....


   
willyd57 reacted
ReplyQuote
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter  
Posted by: @hans

Hi Bill,

Your Pi's IP address appears to be a public IP address (see here)?
This doesn't seem to be correct unless you're somehow directly connected to the Internet?

Anyhow, this will probably not be the reason why you cannot SSH into your Pi - it is however something to look into.
Unless something in your Pi is blocking non-local LAN IP addresses.

I'd check first why the IP Address is a public IP address ....

Thanks for the great reply Hans, and I am glad to see you also think it's odd that the rpi has a public IP. I will be looking into that today. In the meantime I have run my ssh command using verbose mode. The output is below. 

c:\Users\billa\.ssh>ssh -vvv pi@raspberrypi.local
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug3: Failed to open file:C:/Users/billa/.ssh/config error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug2: resolving "raspberrypi.local" port 22
debug2: ssh_connect_direct
debug1: Connecting to raspberrypi.local [23.195.69.111] port 22.
debug3: finish_connect - ERROR: async io completed with error: 10060, io:0000017F8250FEE0
debug1: connect to address 23.195.69.111 port 22: Connection timed out
ssh: connect to host raspberrypi.local port 22: Connection timed out

 

Thanks again

Bill


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Hi Bill,

it's a little odd that "raspberrypi.local" actually resolves to "23.195.69.111" ... 

I also found that error 10060 means:
The error is an indication that the outgoing port is blocked and unable to communicate with the server.

I think fixing the IP address first could possibly fix the issue 😀 


   
ReplyQuote
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter  
Posted by: @hans

Hi Bill,

it's a little odd that "raspberrypi.local" actually resolves to "23.195.69.111" ... 

I also found that error 10060 means:
The error is an indication that the outgoing port is blocked and unable to communicate with the server.

I think fixing the IP address first could possibly fix the issue 😀 

What you are saying about the outgoing port being blocked makes sense. Because when I first plug the board into a :USB port, I get an error in device manager that talks about not getting the device ID. Therefore, It can't load a driver for the board because it doesn't know what it is. And that leads to never assigning it a com port. 

The really odd thing about the public IP address deal is that I have three different Pi Zero boards, and they all have the same public IP address of 23.195.69.111. 

Off the top of my head I don't how to change the IP addy, but I will figure that out. We will see if that fixes things! 

Thanks so much for your feedback on this. It was very valuable info!  


   
ReplyQuote
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter  

In case this is unfixable I ordered a new RPi zero 2 W. Man, they aint five bucks no more. I paid just short of $50.00 for my new one and was lucky to find one at all. I'm a hobby beekeeper living in Iowa where the winters can dip down to -20 / -30 below F. So I'm relying on this pi zero to run a hive heater that monitors the timp in the hive, turns a 12v heater system, and writes all the data to a DB on a web page. I am tired of spending $300.00 every spring for new bees in my two hives!


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Oh wow, that is actually pretty cool! 😊 

Just being curious ... so your Pi registers temperatures and if needed turns the heater system on or off.
Why did you select a Raspberry Pi for this?
Seems an expensive solution that can be fixed with an Arduino, or even better an ESP8266 (see my guide on how to use an ESP8266 as an Arduino replacement). And especially since a set of 3 (!!) ESP8266 will run you about $15 (link - search results on Amazon).
The ESP8266 is very compact, and has WiFi build in.

Since you have the Pi's right now: Let's continue with that. You do not need to get a new Pi for the SSH issue and the IP address. A new one wouldn't fix it.

Posted by: @willyd57

The really odd thing about the public IP address deal is that I have three different Pi Zero boards, and they all have the same public IP address of 23.195.69.111

Well, that most certainly is a problem ... you won't be able to determine which of the Pi's you're connecting to.
It's is definitely a misconfiguration somehow.

Would you mind posting your config file (remove or change the password before posting!)?
Since all 3 are getting the same IP address, I'd assume you've set your Pi to use a fixed IP address, since a DHCP for your WiFi would never hand out a public IP address, and it would never hand out the same IP address 2 or 3 times.

Worth looking into! 😀 

 

 

* Reference: Raspberry Pi "wpa_supplicant.conf " documentation


   
ReplyQuote
(@Anonymous)
Joined: 1 second ago
Posts: 0
Topic starter  

Hello Hans! 

Yea, this is a very cool project, and more importantly it should save me both money and time managing my bees. The requirements I have for the final build includes using MQTT to send temp and humidity readings from the hive to a cloud server where they will be written to a database along with external temp and humidity data that I plan to capture via a free weather condition API service that I found on the web. That way, I can evaluate not only the heater part of the project, but also determine how effective my winter hive insulation materials are by comparing temp outside the hive with the internal temps. Version 2.0 of this system will include a car battery backup with a solar charging unit that sits on top of the hive so in case the power goes out in my home I can run the heaters off the battery for a couple of days or so. It gets really really cold here. Last year the temp dropped to -30F for three days straight.

Anyway, back to my technical issues. I was using a esp8266 nodeMCU board in the beginning but ran into some serious issues with it as well (I know right?) I was flashing the firmware using esptool, and uploading my python code using ampy. Life was good for a couple of days then things went South on me. esptool quit working for flashing firmware (but worked fine for erasing the firmware) When writing firmware it would connect to the com port, but timed out after beginning the write process. Oddly enough, I was able to configure my arduino ide to upload code to the esp board, and it worked just fine. But, now I have to take all my python code are rewrite it using the arduino language syntax. For for background on this problem click here! So, because I had three pi zero boards laying around so I tried substituting one of them for the esp8266. That way I could continue developing using my existing python code.

Below is the content wpa_suppliment_conf file. All it really does is give the board my ssid and pwd. Never thought about using it to fix this issue!

 

country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
scan_ssid=1
ssid="modem2"
psk="BlaBlaBla123"
}

Bill

 

  


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
 

Hi Bill,

I'll admit that I had to lookup MQTT (here is an Arduino MQTT example, so the ESP8266 would be able to it as well).

Reading more on your project,  cannot help getting a little excited as well, since it has Arduino written all over it (where I write Arduino, read "ESP8266" haha).

I'd use one of these very affordable DS18B20 temperature sensors (see my little project), one for outside and one for in the hive. This way you get the most reliable data. Most online services, tend to be a little off compared to the actual temperature in your own backyard.
Additionally, I've ran into free services that just disappeared over time or became commercial - a reason why I'd rather do everything myself 😉 ...

Not sure if the weather there is comparable to Wisconsin, but most winters tend to be quite sunny (good for solar).
With car batteries I'd be worried, as with any battery, that they will drain too fast when temperatures outside are too low.
Then again: it's not like I have a better solution for it. Car batteries should be able to power Arduino's and ESP8266's real easy since the barely use any power.

Indeed back to the original question 😉 

So I never used Python with the ESP8266 - I use plain Arduino C code, which is quite easy and doesn't require any kind of firmware flashing 😊 
On that note: I'm not a big Python fan myself - it has it's (limited) purpose. But yes issues like that would ruin the motivation for sure for me as well ...

Well, as far as the config gos, I do not see anything there that would cause this issue.
When you connect to "modem2" (assuming this is you modem/router) with your PC, can you login and see what IP addresses have been handed out or what IP range is being used?
I still find it quite odd that your Pi is getting a public IP address, AND that 3 Pi's get the same IP address. 
I would assume you did not have any additional config info that potentially would set the IP address to a static address right?

(Your modem does not happen to be set in some sorts of bridged mode right?)


   
ReplyQuote
(@Anonymous)
Joined: 1 second ago
Posts: 0
 

SH supports different types of server access security, like file transferring and synchronization, FTP over SSH, secure copy, and private network access to the server with OpenSSH. So, you will be able to connect your website using an SSH client to transfer data securely through a GUI or a command line.


   
ReplyQuote
Share: