Trying to setup MQTT Server for RAK 4630 Weather Station

A current limited power supply? I have no clue what this is. Can you send me an example so I can find what part I need? Also they recommended this gateway for the project https://store.rakwireless.com/products/rak7243c-pilot-gateway but I have the D0+ coming in, will the D0+ be enough for my projects? How would I power this thing once it’s outside?

Would something like this work for testing? https://www.amazon.com/LW-K3010D-Adjustable-Switching-Regulated-Spectrophotometer/dp/B07512KQDW/ref=sr_1_5?dchild=1&keywords=current+limited+power+supply&qid=1633368039&sr=8-5
What would work for an outside prototype to power it that you can recommend I look at buying and how much power do you recommend I use for it? What would be a safe level, I have no clue what range of current I would even need to use

The D0+ gateway should work fine if you just want to have a LoRaWAN gateway for testing.

I am not sure if that amazon link is current limited. Some Chinese Power supply have current limited shutdown and no constant current (CC) mode. Personally, this is the power supply I use https://www.digikey.com/en/products/detail/sra-soldering-products/KD3005P/10709862.

It has CC mode and is programmable. There are many factors to consider when buying equipment. It really depends on you, your needs and your projects.

For the current consumption, I am surprised that there is nothing mentioned in the datasheet of the sensor. But I doubt that the sensor will consume more than 100mA so setting the current limit to 500mA should work fine I think for the whole project

Btw, @a1projects what I can share you here in forum is very limited and there are many factors involved when you work on this project even it looks simple. Many scenarios can happen to it like when wires are accidentally switched from + to - , mixed the wires of the sensors, etc. These are the things you have control of. I can’t say to you all the step you need to take one by one.

I don’t see anything here WisBlock/examples/RAK4630/solutions/Wind_Speed_Monitoring at master · RAKWireless/WisBlock · GitHub do you?

It is the software example code with explanations. That github repo should have a readme.md and a Wind_Speed_Monitoring.ino sketch file.

The datasheet of the sensor can be found here here https://www.ubibot.com/wp-content/uploads/dlm_uploads/2020/11/Wind-Speed-Sensor-210225.pdf. This is the same link I posted above few days ago.

The wiring connection of the sensor should have (+), (-), and the RS485 pair. Usually, Red is for positive (+) and Black is for negative (-). What’s left will be the RS485 pair.



I plugged the wind sensor up to 9 volts and ran the code,I keep getting this error in my Arduino log.
Side question: there was a black and red wire, and green and white. Would the white go where the yellow wire did on the diagram you sent me a few posts up since it doesn’t have a yellow but has white and green?
Also is there any way to make the gas sensor read AQI instead of hms? I can’t seem to find anything about converting it!

Hi @a1projects ,

Failure in reading the registers might mean that the RS485 lines are broken. What current consumption does the sensor gets from the power supply? In your image the ground of the sensor is not attached to the ground of the WisBlock. Can you connect it and try again?

On the connection, exchanging green and white wont hurt since RS485 signals are differential. You can see if that will do the trick.

We are using Adafruit library in the example so there is no AQI. But you can try this code from Bosch itself BSEC-Arduino-library/basic.ino at master · BoschSensortec/BSEC-Arduino-library · GitHub.

.01 amps was what it said it was using. Where is the ground of the wisblock at? In the photo example they just had the black wire connected to the ground of the power supply

You can use the GND in the RAK5802 module.

Theoretically, you do not need the ground since the lines are differential. But it won’t hurt ensuring that your ground potentials are at the same levels.

If you have an oscilloscope in your lab, you can also check the RS485 bus if any data is being transmitted.

I do have an oscilloscope, where would I use it though to check if the data is being transmitted? What part does it need to be in contact with?

This can be a good guide Decoding Sensor RS485 Output with an Oscilloscope | Life, The Universe and ... Everything! :+1:


How many amps do I need to use with this? I got my power supply in. When I plug it in, it’s reading .02 amps at 5 volts

There is no legacy packet forwarding option on TTN anymore when registering the gateway, I put my device EUI in and it just says disconnected

Hi Sam,

With the Amps, are you referring to the current limit you need to set? 0.5A should be ok I think. If you see that you hit CC in any situation you can increase 0.5A slowly but I think 0.5A is already high.

With the gateway registration, you must use TTN V3 and not TTN V2. You cannot on-board gateways to TTN V2 anymore. Here’s the link for TTN V3 - https://cloud.thethings.network/

Please follow this guide how to onboard the gateway to TT V3 Updated tutorial for setup with TTN V3 / TTS? - #2 by Martin

What about the voltage, is 5 volts ok for the wind sensor? If not how many should I use? Ok thank you, I am going to try and configure it with this technique. Thank you! One issue I am having is that when I try to ssh back in the device is freezing up. Sometime I can get into the rak welcome terminal screen but can’t get past that and then other times I can’t even get that far. I tried restarting it but that didn’t fix the issue

I am not sure if 5V is ok. Can you confirm with the datasheet?

For the issue of terminal screen, is it for the gateway? Can you make a separate post regarding that so our gateway expert can support? Probably include some details or screenshots when it starts to freeze. I am using SSH on all my RPI gateways and all is fine except if I get disconnected to the network.


I am not sure which voltage to use, and why it has all these different increments. The power supply you recommended doesn’t even have a way to adjust resistance does it?

What would the payload for the scheduler .ino need to look like since it has both projects combined? I have this right now for the environment one, what do I need to add on to it to get all the data?

function Decoder(payload, port) {
    if(payload[0] === 0x01) {
        return [
            {
                field: "TEMPERATURE",
                value: (payload[1] << 8 | payload[2]) / 100
            },
            {
                field: "HUMIDITY",
                value: (payload[3] << 8 | + payload[4]) / 100
            },
            {
                field: "PRESSURE",
                value: (payload[8] | (payload[7] << 8) | (payload[6] << 16) | (payload[5] << 24)) / 100
            },
            {
                field: "GAS",
                value: payload[12] | (payload[11] << 8) | (payload[10] << 16) | (payload[9] << 24)
            },
            {
                field: "COUNTER",
                value: payload[16] | (payload[15] << 8) | (payload[14] << 16) | (payload[13] << 24)
            }
        ];
    }
    if(payload[0] === 0x02) {
        return [
            {
                field: "TEMPERATURE",
                value: (payload[1] << 8 | payload[2]) / 100
            },
            {
                field: "HUMIDITY",
                value: (payload[3] << 8 | + payload[4]) / 100
            },
            {
                field: "COUNTER",
                value: payload[8] | (payload[7] << 8) | (payload[6] << 16) | (payload[5] << 24)
            }
        ];
    }
    if(payload[0] === 0x03) {
        return [
            {
                field: "LIGHT",
                value: (payload[4] | (payload[3] << 8) | (payload[2] << 16) | (payload[1] << 24)) / 100
            },
            {
                field: "COUNTER",
                value: payload[8] | (payload[7] << 8) | (payload[6] << 16) | (payload[5] << 24)
            }
        ];
    }
    if(payload[0] === 0x04) {
        return [
            {
                field: "COUNTER",
                value: payload[4] | (payload[3] << 8) | (payload[2] << 16) | (payload[1] << 24)
            }
        ];
    }
}

Any idea beegee maybe on this payload build?

Ok now that I have gotten the device connected to the network again, I am noticing the weather station scheduler script is the only one not working now. It stays at this below for both Helium and TTN

=====================================
Welcome to RAK4630 LoRaWan!!!
Type: OTAA
Region: US915

=====================================
Welcome to RAK4630 LoRaWan!!!
Type: OTAA
Region: US915