I am very new to LoRa and I want to set up an end-device to join ttn network. I have a Rak811 (v3) LoRa module (LoRa node phat) on a raspberry pi compute module 4. I have already registered it on TTN with the DEV_EUI and JOIN_EUI that I got from the config when using the comand Rak811v3 get-config lora:status. I generated an APP_Key which I set to the same value on my lora module.
I want the lora node to join the network: for this I do the following steps:
set the work_mode to LoRaWan
set the join_mode to OTAA
set lora region to EU868
set APP_EUI and APP_key to the values I used for TTN registration
set the datarate to 5
use the join command to join the network
But I get the following error:
Traceback (most recent call last):
File “/home/admin/Mausmaki/lora_node.py”, line 33, in
lora.join()
File “/home/admin/Mausmaki/venv/lib/python3.11/site-packages/rak811/rak811_v3.py”, line 508, in join
self._send_command(‘join’, timeout=self._event_timeout)
File “/home/admin/Mausmaki/venv/lib/python3.11/site-packages/rak811/rak811_v3.py”, line 261, in _send_command
raise Rak811ResponseError(response[len(RESPONSE_ERROR):])
rak811.rak811_v3.Rak811ResponseError: [Errno 99] LoRa join failed
What could be the possible reasons why my end-device cannot join the network? It should be possible without having my own gateway right?
Thanks in advance for answers.
Only if the node you have built is in range of a TTN GW…where are you? Where is nearest node? can you get closer to the public GW? Do you have clear LOS to the GW?
If I look on the TTN gateway map the closest gateway is 1.4km away. I am in Zurich near Oerlikon so the LOS is not clear there are a few buildings in between. Is this too far away?
It won’t be the distance that is main issue but rather a combination of your nodes and the nearest GW’s elevation and how you can overcome the substantial building and topology cluter in that area. It will also depend on just where you are relative to the GW’s - (CH)Kaferburg and Zurichburg green areas/hills will have impact if you are wrong side wrt GW locations. Then again take a hike up Kaferburg and likely you may have decent LOS to a number of the Zurich GW’s. Fortunately for you, you are in an area with one of the highest GW counts on TTN - not withstanding some high density networks that peer through packetbroker, but who may not be sharing GW access to us on TTN. What I would suggest is if only 1.4km (I see 4 GW’s north of the Oerlikon area) then if weather not too bad over weekend power your node from battery and take a war drive closer, or cycle, or take bus/tram or even walk it’s not that far! And if correctly set up you should get decent chance to connect to the TTN LNS through atleast one of the GW’s. You might also move the DR out a little to try and help - maybe SF8 or 9? SF7 may be pushed to reach in such a high urban density areas especially with many large buildings and a lot of railway infrastructure or higher elevation major roads all of which might screen you. I see also Zurich Uni has a building to N,East of area - perhaps you can visit and get to high elevation in the building. The GW up near the rail infrastructure and Grunhalldenstr area looks to be a TTIG or even an original TTKGW- and likely indoors so may not have great range (looking at name I wonder if the Squix78 is the same Squix who did the blog post on capturing TTN data to Google Sheets many years ago! ) so maybe best option would be the open area/playgrounds around Oelier Park where there is a GW in close proximity! Taking a bus/tram journey Bahnhof Oerlikon Ost/Seebacherplatz might allow hits to one of the 3 GW’s in that general area but again concerned about local building clutter, bridges. rail/road infrastructure etc.
Also take a look at TTNMapper to see where people have successfully mapped in the past and see if your location is covered/close to covered or then take your node to a well mapped area and try there! (See below)
Best option may be get yourself a GW then you add to the density/expand the network as well as give yourself a useful debug tool to watch device traffic
Thanks for the detailed answer. I will try to get closer to different gateways tomorrow. And also adjust the data rate. If it still doesn’t work, what could be possible errors in the setup of the node that would prevent it from connecting to the network?
Not owing your own gateway - search the forum for the many people in your situation that ask this - a couple of times a month - that find it so much easier & warmer to own a TTIG so you can see exactly what your device is doing locally.
I set up a Rak833 gateway on a Raspberry Pi, I was able to join the network with my end device using this gateway. However, it only worked a few times. Sometimes I still get the error join failed, is it normal that it doesn’t always work?
So if I understood it correctly the frame counters also get reset if I do a hard-reset and reconfigure my lora node. So that should not be the issue. But it still does not connect sometimes. The gateway sends a join accept message but I still get the error lora join failed on the node…