Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Delphinus

611 posts

Ultimate Geek


#257316 25-Sep-2019 17:07
Send private message

I have an Adeunis LoRa pulse counter connected to The Things Network. I can send it downlink frames to change registers in it.

 

From the documentation: https://www.gowifi.co.nz/specs/PULSE_LoRaWAN_AU915-928_UG_V1.0.0_FR_GB.pdf

 

Page 72 gives some detail on the registers able to be changed. I have successfully changed register 301 to 5 mins by sending 41 01 00 05 (the extra 00 is because S301 register's size is 2 bytes).

 

However what would I send to change 321 to Value 1 - this uses Hexadecimal instead of Decimal, and uses bits 0 to 2 for the configuration. Any ideas?


Create new topic
worzel
4 posts

Wannabe Geek


  #2324736 25-Sep-2019 17:44
Send private message

Short Answer: same as you did for decimal (provided value is less than 10).

 

Long Answer:

 

Hexadecimal is the same as decimal for numbers from 0 to 9, then it uses letters A to F to represent decimal 10 to 15.

 

With 2 bits there are four possible values which as Binary, Decimal, Hexadecimal are:

 

00, 0, 0 

 

01, 1, 1 

 

10, 2, 2

 

11, 3, 3  (not used for your device)

 

To distinguish between the various bases, binary is often written as 0b01, and hexadecimal as 0x01

 

 




SirHumphreyAppleby
2849 posts

Uber Geek


  #2324747 25-Sep-2019 18:47
Send private message

Hex and decimal are represented exactly the same way from the point of view of the computer.

 

What the documentation appears to be doing is using the term decimal to represent a number, and hexadecimal where individual bits or groups of bits need to be set. That's not strictly correct, both will do the job perfectly well. It's possibly due to the fact that C (which the firmware is likely written in), doesn't have a way to represent binary numbers, only hex and decimal.

 

Register 321 is simple as it's a single byte. Simply setting the value to 0, 1 or 2 should work.

 

320 is more complicated as it has two distinct functions, each of which use 4 bits. It's unclear which are the high and low bits, but one would need to be shifted 4 bits to the left. In C, this would mean assigning (value_chan_a << 4) | value_can_b, assuming the most significant bit controls Channel A, to set both channels (they cannot be set independently). The value of value_chan_n can use decimal or hex notation, it matters not to the computer.


Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.