Raspberry pi on remote network (all done works are mentioned in details) - ssh

Firstly,here, I will mention all what I did to make raspberry pi as a web server or as a data cloud. But all the issues which were applied did not work. There are some problems in somewhere , but I dont know where, what , how.. ?
So let me start.
Firstly,I booted my raspberry pi with Raspian OS. It works in a best manner for sure.Then, I installed ntfs-3g to make it possible to read my hard drives by raspberry pi.
When I connected my hard drive (500 GB), raspberry pi went crazy,it freezed and so on.
I have two hypotheses. One of them , maybe hard drive could be so huge for raspberry pi to read and it could take lots of time to read.
But someone could do with 1TB hard drive. So this one is dead!
Another hypothesis is that hard drive is formatted with NTFS. Maybe it could be problem.
At first, I booted raspberry pi from a usb storage and when I connected that hard drive, raspberry tried to boot itself from hard drive, not from usb.That's why this is one another hypothesis. I havent disproved this yet. But i will and let you know.
Although I could not connect my hard drive to raspberry pi, I gave a break to that issue and I tried to create a connection from remote network to my raspberry pi.
I made raspberry's IP as a static. I could connect it from ssh and file zilla(ftp) LOCALLY. I disabled firewall of my router and observed my router's external IP. It has not changed for many days although I dont have a static external IP. Then, I arranged my port forwarding like these
"router_external_IP":8080 destination(raspberry's internal IP) is 22 (for SSH)
"router_external_IP":9000 destination(raspberry's internal IP) is 80 (for HTML)
"router_external_IP":8500 destination(raspberry's internal IP) is 3306(for mySql)
When SSH server and Mysql server ran on the raspberry pi, I tried to connect to raspberry pi
by SSH with "router_external_IP":8080 (from putty)
by browser with "router_external_IP":9000
by browser with "router_external_IP":8500
NO ONE WORKED :( ! [By the way, I installed web servers on it, but i did not mention]
Someone can say that "Are you sure about ports are open ?".
Yes I am sure I checked it out. But I am not sure on my router are forwarding these ports to raspberry pi or not . Also, I can not debug it.
Actually, I have 2 hypotheses on that also.
First one is that maybe router does not forward these ports to raspberry pi.
Second one is that maybe I am doing something wrong and that is why although router forwards all given ports to raspberry, raspberry can not respond.
I can not disprove these since I dont know how to debug.
I do not know what to do. I just got lost. Please help me on these issue.

An easy way to check if your router is forwarding your ports is to check them at: http://canyouseeme.org . If, as you say, all your ports are open on your internal network, if "canyouseeme" can't see your services then you know you need to tweak your router settings.

Related

Raspberry Pi wifi LAN Server how to?

I want to run a Node web server on my Pi, and connect to it via the Pi's wifi. The idea is that I can access the server when I am in the middle of nowhere and just plug the Pi to a 5V output and login the server through my phone. I just want to setup the pi as a LAN network.
Through past research and tests I managed to turn my Pi into an access point but I lost the ability to SSH to it.
At the moment I have a Node server running a webpage and I am able to connect to it as the Pi is connected to a wifi router.
I am wondering if I just need to turn my Pi into an AP or if I need to do some port forwarding too.
My current setup is a RaspberryPi4 with Raspbian and running Node.
Edited -
Added "I just want to setup the pi as a LAN network."
In the raspberrypi.org documentation has all the information, in the AC I recommend using a wifi adapter, but you can use the pi interface.
https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md
you do not need to configure dhcp, as the site may be located on localhost 127.0.0.1
and recommend to access by phone
https://www.raspberrypi.org/documentation/remote-access/ssh/
if you have any problems in the configuration process put it here

Trouble setting up Raknet Server on Raspberry Pi

I have been trying to get Raknet up and running on my Raspberry Pi (2).
I am using a simple client server test program to connect from my windows machine to my raspberry pi. Using tshark on the Pi I can see that all message are arriving on the Pi. However, the server application does not seem to pick those up. As far as I can deduce all ports are open, the machines are on the same network, the code is correct (taken from some github repo with examples for raknet).
The frustrating thing is that a while back I though I solved this communication by starting my server app as root (sudo). However, in the meantime something has been changed in my setup which makes this no longer the case. Any help is appreciated.
I completely forgot about my question here. It actually had to do with privileges on the networks we use here. I had been testing on two different networks without realizing. Problem has been solved.

Cannot remote into raspberry pi via hostname

Let me start by saying that I have no experience with Linux and this is my first attempt at getting into the IoT with a raspberry pi3. My question is why can I connect via ssh to my pi when I use the ip address but not the hostname?
After getting everything set up at home, I tried to remote in via PuTTY from my laptop. (The laptop is less than 6 months old and if I need to provide the specs on it, I can. It is running windows 10 if that matters). It worked when I entered the ip address of the pi, but when I tried again with the host name (which is clearly defined in the raspberry pi configuration) it said host does not exist. I used hostname.local and still failed.
Today, I brought the whole setup to work to try a few more scenarios. From my work desktop, which is running windows 7 and not wireless, I could remote in via hostname.local. I then tried again on a different laptop running windows 7 and it worked too. Next attempt was on another new (less than 3 months old) laptop running windows 10 and it failed to remote in via the hostname.
This would tell me that there is nothing wrong with my home network or the network at work, and it also makes me think that this has nothing to do with the pi, since other computers can resolve the hostname to the ip address and successfully login. What the hell am I doing wrong or missing?
I spent 2 nights googling and browsing forums trying to find an answer for this but cant, so instead of bashing this post, please poke me for more information you think might be helpful for a solution.
EDIT I gave my computer and PI to my cousin to fix. He installed Samba, though I don't know what it does differently. After doing more research, it sounds like the problem I was having was a DNS issue. I don't know how it was resolved by downloading samba on the pi, but I can now connect via the hostname.
So if I understand correctly it would appear that there is some particular settings on that laptop preventing you from using SSH if that is the only thing you are changing? I think this is likely to be something to do with the security settings on the laptop but Windows isn't my thing sorry.

How to scan network for devices, using C Obj C or Swift

I have a server running on a Raspberry Pi and a client running on my Mac and iPhone (soon Apple Watch). I would like to connect to my server automatically without finding the Raspberry pi's Ip-address.
Is there a way to lookup all the devices on the network, and select by Mac-address, name or something else? I know that the first 3 bytes of the mac-address is the same for all Pies. (B8:27:EB) Maby i can use that information.
I have been looking for a solution for this issue a while but i can't seem to find one.
Zeroconf (aka Bonjour)
IMO, the best way to do this is to have your Raspberry Pi advertise itself on the network using Zeroconf (aka. Bonjour).
On the Raspberry Pi, install avahi-daemon and configure it to advertise whichever service you'd like to connect to connect to, for example, if you're connecting via SSH, you'll need to do something like this.
In Cocoa, you can use NSNetServiceBrowser to find the advertised service.
Possible MAC Address solution
Alternatively, if Avahi-daemon is not an option, you may be able to use the MAC address. I will not go into the specifics in Objective-C, just a high-level overview using the command-line.
In terminal, type ping 255.255.255.255. You will get back ping packets from every device on the local network. For each IP address, send an individual ping e.g. ping -c 1 192.168.x.x. Then, type arp -a. You will see the MAC address for each IP on the local network. From here, you can perhaps use your MAC address filter to find Raspberry Pis.
Why does this work? Well, the first command ping 255.255.255.255 sends a ping in an IP packet to the 'broadcast' address, which means all machines on the local network respond. When you ping the individual IP addresses, the low-level networking stack uses ARP to find the MAC address of the IP to directly send a ping to it. In doing so, the ARP tables on the local machine are updated with the cached values.
Maybe you can use this method in your app to discover local Raspberry Pis.

RasPi SSH Not Working

I'm using Mac OS X and trying to SSH into my pi. I have the pi boot up in front of me, and I can see that the IP address is 192.168.0.13.
However, if I ping the router on the A Record address I assigned to it, it responds.
When I boot the Raspberry Pi up, it showed:
My IP address is 192.168.0.13
Raspian GNU/Linux 7 subdomain.domain.com tty1
subdomain login:
I was surprised that it showed the subdomain and domain on login (I'm a Linux newbie).
Ever since i set up the subdomain to go to my pi and set up the port forwarding and firewall exceptions on my router, I never really used the pi itself, I always SSH into it. It stopped working for the past week for some reason. There's nothing I installed recently except nginx, but that shouldn't affect it right?
Any troubleshooting advice? Can't seem to find anything newbie-friendly online.
Will be more than happy to provide more information, as I think I haven't provided enough here but don't know what else to add!
Many thanks in advance :)
EDIT: I was pinging the incorrect address! It's ...0.13 not ...1.13 :) Apologies!