MQTT_VPN icon indicating copy to clipboard operation
MQTT_VPN copied to clipboard

doubt: accessing ports on the nodes

Open beckmx opened this issue 6 years ago • 10 comments

I was reading your readme file and was wondering if after getting an IP I can access whatever port on whatever protocol? for instance if I want to get the 80 port to see a page in the module and then switch to another port to see stream of images, can this be done?

beckmx avatar Aug 06 '19 23:08 beckmx

Yes, you can. You can access any port on the participating nodes. Without further software (routing), you cannot accesss nodes outside the VPN.

martin-ger avatar Aug 07 '19 04:08 martin-ger

From what repository is this dependency? nacl/crypto_hash.h

beckmx avatar Aug 07 '19 17:08 beckmx

Package libnacl-dev

martin-ger avatar Aug 07 '19 17:08 martin-ger

wow, I just tested, it works like a charm, if it is not much to ask can you elaborate how it works behind the scenes in the ESP?

beckmx avatar Aug 07 '19 18:08 beckmx

I have been pushing in forward a little bit more each time, I used the esp32 cam demo project and responds good, and then in the stream part I noticed something, the firsts couple of frames are sent but then it usually stops with this message:

I (30741) MQTTIF: Received mqttip/10.0.1.97 - 96 bytes
I (30821) MQTTIF: Received mqttip/10.0.1.97 - 96 bytes
I (30821) MQTTIF: Received mqttip/10.0.1.97 - 96 bytes
I (30831) MQTTIF: Received mqttip/10.0.1.97 - 96 bytes
assertion "tcp_receive: valid queue length" failed: file "/Users/esp-gnu/esp-idf/components/lwip/lwip/src/core/tcp_in.c", line 1123, function: tcp_free_acked_segments
abort() was called at PC 0x400dab8f on core 0
0x400dab8f: __assert_func at /builds/idf/crosstool-NG/.build/HOST-x86_64-apple-darwin12/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/assert.c:62 (discriminator 8)

Do you think I should focus on the esp32 lib to find the issue or more on the linux IF

beckmx avatar Aug 28 '19 03:08 beckmx

I would guess, it is an ESP issue. Does this happen under high load? "tcp_receive: valid queue length" failed" sounds like a kind of overflow...

martin-ger avatar Aug 28 '19 05:08 martin-ger

it does happen when I .try to stream images "like a video" if I call it directly in it's real physical IP it streams, and when called over the vpn it stops, btw I just discovered that if you use 10.0.1.200 or bigger than x.x.x.99 the linux IF creates a strange topic in mqtt

beckmx avatar Aug 28 '19 05:08 beckmx

you were right, I had to add 1200 ms to the stream between each camera shoot, that way the IF in the esp32 manages to keep memory afloat

beckmx avatar Aug 28 '19 05:08 beckmx

wow, I just tested, it works like a charm, if it is not much to ask can you elaborate how it works behind the scenes in the ESP?

how did you manage to get this running on Linux? I installed libnacl-dev, but mqtt_vpn.c does not want to compile, the error persists: / usr / bin / ld: /tmp/ccs2jNoK.o: in the "msgarrvd" function: mqtt_vpn.c :(. text + 0x8dc): undefined reference to "crypto_secretbox_xsalsa20poly1305_ref_open" / usr / bin / ld: /tmp/ccs2jNoK.o: in the "main" function: mqtt_vpn.c :(. text + 0xfa0): undefined reference to "crypto_hash_sha512_ref" / usr / bin / ld: mqtt_vpn.c :(. text + 0x1874): undefined reference to "crypto_secretbox_xsalsa20poly1305_ref" collect2: error: ld returned 1 exit status

I'm already tired of looking for a solution, was it really difficult for the author to write a couple of lines of what and how to install, many, including myself, do not understand how to do this = (

pastry777 avatar Jan 04 '22 18:01 pastry777

I managed to compile with the command: gcc -o mqtt_vpn /mqtt_vpn.c -l paho-mqtt3c -l nacl

pastry777 avatar Jan 04 '22 19:01 pastry777