Where is this so called documentation for MQTT / server v3? I must be blind, but I can't find any documentation on V3 protocol except a short paragraph to say it is recomended for developer use only.
I have it working locally on my network, and I now want to use it remotely over 3g/4g.
I have forwarded port 8883 in my router, but I suspect because I am using an unsigned certificate in mosquitto, OVMS is failing to connect.
I'm getting
mongoose: mg_ssl_if_mbed_err ..... SSL error: -9984
Do I need to setup mosquitto with a signed cert via LE, or can I disable certificate checking in OVMS?
There isn't really any documentation for v3, as it is still experimental and under development. All the Apps and servers we have are v2 protocol at the moment.
If you really want to use it (for home automation, etc) the best is to search the developer's mailing list archives.
The issue you are having is most likely trusting your self-signed cert. You can find information on how to handle that here:
Thanks very much for your help!
Unfortunately though, I am still having major trouble with getting the ssl handshake to succeed.
Here are my log entries. I think I am still having the same error I have been having from the start, but I have sunk a fair few hours into getting my ssl certs working correctly.
When I run this command on another device
openssl s_client -connect XXXXXXXXXX:8883 -servername XXXXXXXXXXXX -showcerts </dev/null
I get this, which I think means my cert is working correctly
Server certificate
subject=CN = XXXXXXXXXXX
issuer=C = US, O = Let's Encrypt, CN = R3
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 4936 bytes and written 389 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
DONE
So does it look like I'm just not loading my ca.pem file into ovms correctly? Or have I possibly missed something else?
See manual, it seems you're now using a cert issued by Let's encrypt, so you don't need to add a PEM for that.
Back to your OP: you wrote the OVMS can connect locally, i.e. via Wifi. If only connecting via cellular fails, you should check if your cellular provider blocks port 8883. And you should check if your router config actually works for external connections.
Another option is to check if there's an issue with your host name vs. the DNS used by the module.
After another late saturday night chipping away at this, I finally figured it out.
I think my SSL configuration was ok the whole time, but my firewall (pfsense) was blocking some traffic between my IOT network, and my LAN. Even if I created a rule to explicitly allow all traffic from OVMS to mosquitto, the traffic was still blocked. By the sound of it, there could be some weird stuff going on in the packets which pfsense is picking up and decides to block.
Anyway, with OVMS on the gsm network, with Server V3 running, it now connects and starts working.
Thanks for your help!