I’ve tried that. It certainly says I am subscribed to the TTN MQTT server (status: connected) but there are NO messages at all. Normally, of course, if I subscribe to #, I’ll see everything. I’ve tried your suggestion and others using the documentation examples, but all to no avail. So, again, does this mean that I’m really not connected? I did ‘update’ the MQTT API (actually, just hit save again) and this gave me a message: ‘Console - stream connection closed’ followed by ‘Console - Stream reconnected’
(The Console was able to reconnect to the internet and resumed the event stream. Subsequent event data will be received and displayed. Note that event data which was possibly emitted during the network disruption will not be re-delivered.). So, that sounds promising, yes? Thanks for your very speedy assistance!!
You need to look in the console - application - end devices - “select the device” - live data. What do you see there?
Trust me the topic needs to be correct, this is for all devices in the application-
I’ve taken a screen-shot of the tab you suggest and here it is:
(Ive blanked out the ID. Is that necessary? Oh and it is 15:50 here…)
Just a thought, Johan. There are two MQTT - a public address au1.cloud.thethings.network:1883 and a public TLS address au1.cloud.thethings.network:8883
I’m using the public address (port 1883). Is that correct? (I assume so as I connect OK). But still NO content (subscribed to v3/+/mw001/+/up - and v3/mw001/up just in case…)
Most likely your device didn’t hear the join accept message - the gateways usually have good antenna’s - anything plugged in to a socket is going to be small & low down, both not good.
Also, the concept of range is rather variable - it all depends on what is between the device & the gateway.
Also, we’re not keen on anything that needs regular downlinks - the Fair Use Policy is for 10 a day, we ask people to think in terms of 1 per fortnight - a gateway can’t hear any uplinks from any device whilst it is transmitting.
Thanks Nick. Yes, I can certainly see what you are suggesting. I understand the ‘Fair Use’ policy, and I was under the - possibly false? - assumption that, once connected, the device would only need to have the - very occasional! - ON or OFF message. I’ll try the socket (and it is the socket itself that is a LoRaWAN device - not what is plugged into it) in an external GPO and see if that makes a difference ie no brick walls (and all Perth houses are double brick!!). There is, apparently, a gateway just about 1Km away. More to follow… and many thanks for your advice. I’m learning fast!
Only you would know how often you will need to turn something on or off remotely so it’s up to you to see how it fits in to the community usage.
You should also consider that downlinks only happen when an uplink is made and that neither are guaranteed - so if something important or expensive to run or similar is plugged in, you may experience some unintended consequences in the future!
If the intended end location has any form of WiFi, I’d use that - LoRaWAN is fantastic for sensors uplinking a small (~25 bytes) payload every 15 minutes (or longer), running on batteries - anything else needs a good evaluation to see what any downsides of the technology may bring to the use case.
Rather use this one.
Also for now use v3/+/devices/+/up until you know it works, can make it device specific later.
These sockets are class C so should listen for downlinks all the time. (Power is not an issue for sockets)
Given the repeated joins there seems to be a RF issue for data to the socket. Given that such a socket is inherently near mains wiring that could well be an issue. You could try by plugging it into an extension lead and position it in such a way that there is no wiring close to the top.
Mine works fine like this:
However I do have 5 TTN gateways within 40 meters so it’s hardly representative for a normal deployment.
How far are you from the gateway?
Put it on a extension cord like @kersing suggested, and if the gateway is some distance, stick it in the window.
Thanks to both Jan and Johan. I’m thinking you are both correct - it appears the socket isn’t connecting to the local gateway. I’m in an suburban area, and - from the map - the nearest gateway is about 1Km away. As I’ve mentioned before, we do have a problem here in Perth - we build all our houses of double brick, so wireless transmission generally can be a problem! (And if you aren’t in Australia, which I suspect, we are the only city that does that. Everywhere else it is wooden framed. Why? Lost in the mists of time!!). I did suggest in a post yesterday that I’d try putting he socket into an outdoor plug - I’ve a convenient one at waist height on a wall that would have ‘line of sight’ to the gateway position. Of course, what I really need to do - and ultimately will - is to plug the socket in where I’m intending it to be used, and see what connection is like there. It might well be I am chasing an impossible dream! But we’ll see… Kind regards for your very helpful assistance. - Mike
Thanks, Nick, for your comments, but wifi isn’t really an option. In fact, it is the problem I’m trying to solve! Let me explain - and maybe you can advise me if I’m chasing a rainbow! I have some responsibility for a wifi network that is used by a large number of volunteers. I don’t have any responsibility (and as a volunteer myself, nor should I) for administration of the (‘corporate’) network infrastructure that this runs on. Occasionally, the volunteer network ‘fails’, and we have determined that the best and simplest way for us to get it up and running again is to power-cycle the AP. I fully accept that’s not what you’d probably do if you had admin responsibility for the network equipment, but it works - and we don’t! Now, the complication is that the power board for the AP is both about 3m high and inside a building that isn’t always open. So, currently, someone has to climb a ladder and cycle the AP and gateway router power (and that’s if the building is open) - if the network (which is reticulated via a VLAN over a wide area ) fails. So, in my dreams, I assumed we could power the AP and router via the LoRaWAN socket which, by definition, doesn’t need an active wifi signal. A bit of a chicken and egg issue! Then, if the wifi network failed, someone could - even from outside the building, and without risking life and limb climbing a ladder! - remotely power cycle the equipment and voila! A working network again! So now, perhaps you understand my dilemma? I had hoped (assumed?) we could use an app on a mobile phone to do this, but that may be way off beam. And it could be that I need to go back to the drawing board and determine a Plan B…
Kind regards (and thanks for reading so far!!) - Mike
Jac - I will also add that you have given me great confidence in seeing another WS52 socket and knowing that it works!!
Thanks so much!
Mike
LOL, sure, but only in an over engineering sense!
Plan B - ESP8266 + relay - when no WiFi, turn on relay, wait 5 seconds, turn off relay. Relay is, of course, on the low power lead to the AP. [You can put it on the mains side if you know about mains]
This will solve the problem automagically without anyone having to get an alert to act on (or forget to do).
Although you may want to investigate why the AP goes off line and/or fundraise for a reliable one.
Thanks Nick. I like your Plan V! Not sure if fundraising for a new AP is a valid concept, though…LOL! You’d understand why if I told you more!! Kind regards - Mike
OK, me again! I took the socket to where I’d intended it to go, and left it plugged in, close to a window. And I seem to be seeing some ‘action’. From the TN map, I can see that I should be in range of at least a couple of gateways, and the messages I can see (see attached screen shot)
do seem to be different than those I saw when the socket was at home.
I still cannot see anything in the TTN MQTT server, even subscribing to v3/+/devices/+/up as suggested - and that’s a worry. So, is the socket doing ‘anything’? (Of course, I don’t currently have physical access to it - it’s in a locked building). So, am I getting a connection, or just still fooling myself? And if I am, why no information in the MQTT server, as Johan suggests? Thanks again for all the help…
If you select the message you can actually see what gateways you are connected to, I can see the RSSI is -99 to one of the gateways, you will get more information when selected it.
What do you use for the MQTT?
Thanks Johan. It appears I can no longer ‘see’ the messages I took a screen-dump of. It’s another day here in Perth! And the latest set of messages doesn’t appear to have one that shows a connection (because from your comments, I assume that is what it was). I’ll have to patiently wait and see if I can collect more data later.
For MQTT, I use an application ‘mqtt-spy’ It seems to work very well - it certainly connects to my in-house MQTT server and shows me all the messages I want to see. I set up an external connection to the TN MQTT server, and all the indications are that the connection is successful. (The connection tab turns green if a connection is made, and mine does just that). I use a username as supplied, and the API key as password - exactly as suggested. But NO data! I’ve subscribed, as you suggest, to v3/+/devices/+/up but NO data. Just to be sure, the sequence you have suggested does include the plus sign? It is exactly v3/+/devices/+/up?.
Thanks for all your - invaluable - help! Mike
What intervals are it set to send a uplink?
Send a downlink message from the console to it to switch it, as it is a Class C device it should be listening all the time. (I don’t have the data sheet so I can’t advise you on the payload).