Thingsboard NodeMCU - nodemcu

I have connected the NodeMCU with the temperature sensor and sending the temperature data to the thingsboard, when sending locally ( thingsboard server running on localhost and NodeMCU connected to the same network )its being sent correctly but when sending the data remotely to a system where the thingsboard is running the data transfer fails
By using tunnelling service of ngrok ( command as ngrok http 8080 ) which is converting the localhost to its IP as http://448133bf.ngrok.io -> http://localhost:8080 ( my thingsboard is running here ) and giving this http://448133bf.ngrok.io with the device token id at the nodeMCU its again fails to transfer the data
I have also tried converting the IP of my system as ( command as ngrok http 192.168.43.167:8080 ) which is converting my system IP address as http://f9527176.ngrok.io -> http://192.168.43.167:8080 and giving this http://f9527176.ngrok.io with the device token id at the nodeMCU, but it fails to send the data to thingsboard

it sounds like you have debugged the problem from an Hostname/ IP resolution point of view. I suspect this is either related to the port availability or network firewalls. Are you able to login to the OS that is hosting the thingsboard platform (ngrok) and see which ports are currently in use? (Ubuntu: sudo lsof -i -P -n)

Related

windows: ping url fails but ping -4 url works in local network

I have been learning some network and system administration and encountered a puzzling problem.
SETUP:
I setup a small local offline network with a Windows Server 2019 and a Ubuntu server hosting gitea. In the Windows Server I have assigned a static IP of 169.254.0.2 and installed DNS and DHCP roles. In the Ubuntu server I have assigned a static IP of 169.254.0.3.
DNS has been configured with a primary zone funlab.abc. I created a single A record for gitea.funlab.abc. to point to 169.254.0.3. DHCP has been configured to lease addresses from 169.254.0.100 to 169.254.255.254. Subnet mask is 255.255.0.0.
PROBLEM:
With this setup, I successfully got client machines to connect to the local LAN network, transparently get a dynamic IP address, and access gitea.funlab.abc through the browser.
But in windows 10 client machines, I am unable to run ping gitea.funlab.abc in command prompt. I get an error message :
Ping request could not find host gitea.funlab.abc. Please check the name and try again
Git clone/push operations involving the URL gitea.funlab.abc also does not work.
However I can run ping -4 gitea.funlab.abc successfully. Git clone/push operations can also work if I replace the URL with the static IP. nslookup gitea.funlab.abc works correctly as well.
QUESTION:
Why is this happening? What did I misconfigure such that ping and git commands do not work?
Turns out ping and git commands works just fine when I change the IP address to 192.168.X.X. I guess windows treat the 169.254.X.X addresses differently.

Java mail client can't reach SMTP server from Docker container

I have created simple Java application which sends emails. It's working properly when I running it from my IDE, but when running it inside a Docker container it can't reach the remote SMTP server. I'm using
docker run -d -p 25:25 [image]:[tag]
to expose port 25 when starting the container. Does anyone has an idea why the mail client can't connect?
I think you are confusing the point of the port mapping. This is to allow the host to bind the specified port on the given network interface to the port in the container. In your case you are trying to connect to port 25 i presume on another remote host.
If the app works when run in the IDE I'd assume either an issue resolving the SMTP server or a problem with the address on which the SMTP server is listening.
Are you running the SMTP server locally or connecting to one that is resolvable via public DNS? If you use docker exec to enter the running container can you telnet to the SMTP server?

Access Docker forwarded port on Mac

There is a related post here: Port mapping in Docker on Mac OSX installed with Docker Toolbox
but it didn't work for me
Get ports for container
docker port 485186e65a5e
8080/tcp -> 0.0.0.0:33360
8088/tcp -> 0.0.0.0:33359
19888/tcp -> 0.0.0.0:33358
50070/tcp -> 0.0.0.0:33357
50075/tcp -> 0.0.0.0:33356
8042/tcp -> 0.0.0.0:33361
Check that someone listens to ports in container
bash-4.1# netstat -alnpt | grep 19888
tcp 0 0 127.0.0.1:19888 0.0.0.0:* LISTEN 1094/java
Do wget in container
bash-4.1# wget 127.0.0.1:19888
--2016-04-11 14:16:54-- http://127.0.0.1:19888/
Connecting to 127.0.0.1:19888... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:19888/jobhistory [following]
--2016-04-11 14:16:54-- http://127.0.0.1:19888/jobhistory
Reusing existing connection to 127.0.0.1:19888.
HTTP request sent, awaiting response... 200 OK
Length: 6763 (6.6K) [text/html]
Saving to: `index.html'
100%[================================================================================================================================================================================>] 6,763 --.-K/s in 0s
2016-04-11 14:16:54 (182 MB/s) - `index.html' saved [6763/6763]
Try to access forwarded port from host, no luck... :(((
$docker-machine ip default
192.168.99.100
$ wget 192.168.99.100:33358
--2016-04-11 16:18:04-- http://192.168.99.100:33358/
Connecting to 192.168.99.100:33358... failed: Connection refused.
What do I do wrong?
Omg, desired service started on 127.0.0.1 in container, that is why it wasn't visible from outside world. I've modified service config to start on 0.0.0.0 and now I can access forwarded container port
I had the same problem and was able to fix it by specifying the host that the server within the container uses.
NOTE: when using host below, it means a web server host. When I use host-machine, I mean the main operating system I'm using, (i.e. not a container or a web server, just my laptop as a machine)
The Problem
Running web servers on the container like webpack-dev-server and http-server automatically run the app using a host of http://localhost. Typically you will see that in the output when you start the server. Something like :
Project is running at http://localhost:8080
or
Server available at http://127.0.0.1:8080
On most machines, localhost and 127.0.0.1 are the same thing. This host is not publicly viewable. As a result, your host machine can't see anything, even though it's looking in the right place.
Solution
You should specify a public host when you run the server inside your container.
webpack-dev-server --port 8080 --host 0.0.0.0
or
http-server -p 8080 -a 0.0.0.0
Because the 0.0.0.0 address is viewable to any outside machine, you should be able to see your app working as expected from your host machine.
NOTE: This works for any server, like Python's SimpleHTTPServer, etc. Just look up how to change the host for your chosen server in the documentation
Resources/Nods
(how to run webpack-dev-erver with a publicly accessible host)[How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

Unable to send files using netcat

I am using netcat to send file over my campus network.
I have used
c:\nc -w200 10.x.x.x 9638 < file.txt
on my client machine and
c:\nc -v -L -p 9638 >> nc.out
on my computer that is working as a server to receive files.
It worked completely fine when i tested it using localhost hence sending and receiving files on my system only.I am using the netcat version without the GAPING_SECURITY_HOLE downloaded from http://www.rodneybeede.com/Compile_Netcat_on_Windows_using_MinGW.html.
Our systems are connected to the net using proxy servers. Could they be interfering? Also pinging computers is disabled.
I am working on windows for now.
Yes proxy and router may interfere.
Try to see if you can telnet to that port
telnet <ip> port
That will tell you if you can access that machine on that port

Forward network connection over ssh so that my outbound IP changes

A service, for example an FTP server, only accepts connections from a specific network, where all users will have the same external IP-adress.
I want to connect to this service, but I'm currently not inside the allowed network.
I have ssh access to a server inside the network.
How do I use ssh to tunnel a certain port from my local machine, through a machine on the internal network, to the final service, so that any client opening the correct port won't notice any difference?
You can create a SSH tunnel to your specific network using the following command.
For instance, let's say you want to reach a web service on computer "mywebserver" (port 80).
Under Linux or BSD, using OpenSSH, you can use the following commandline:
ssh -f mysshserver -L 1234:mywebserver:80 -N
Under Windows, you can use MobaXterm which includes a simple graphical ssh tunnel builder
This will open a SSH tunnel between local port 1234 and remote webserver on port 80. You can then open your web browser and connect directly to your web server by typing "http://localhost:1234" in the address bar.

Resources