How to decode 433MHZ Soil Moisture Sensor - arduino

I need to decode Soil moisture sensor using RXB7 and ESP32. I try several library, it can get data but not the correct one. Due to my knowledge on this 433mhz radio, I can't figure out.
Here's the detail I have about this Sensor, which work on RTL_433.
Here's its protocol detail on RTL_433:
https://github.com/merbanan/rtl_433/blob/master/src/devices/rainpoint.c
What I know about it:
It is OOK PCM at 500 µs rate (half-bit rate as it's Manchester)
A Transmission contains three packets with Manchester coded data, note that the pause is a constant pulse, strangely.
**Detail I get on RTL_433_SDR:
**
time : 2023-02-14 14:06:54
model : RainPoint-Soil id : 0603
channel : 1 Sync? : aa81 Flags? : 9f Status? : 0402 Temperature: 32.0 C Moisture : 7 % Integrity : CHECKSUM
pulse_slicer_pcm(): RainPoint soil temperature and moisture sensor
bitbuffer:: Number of rows: 1
[00] {2780} 55 55 55 54 cc cd 2a ac d2 ab 4a ab 55 2c b2 aa ca aa aa cb 52 aa aa ab 34 b3 33 2a ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff da aa aa aa a6 66 69 55 66 95 5a 55 5a a9 65 95 56 55 55 56 5a 95 55 55 59 a5 99 99 57 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff fe d5 55 55 55 33 33 4a ab 34 aa d2 aa d5 4b 2c aa b2 aa aa b2 d4 aa aa aa cd 2c cc ca 80
I have use this code(it's also manchester) and it can receive data but it's not the right value.
https://github.com/robwlakes/433MHz_Tx_Rx/blob/master/Receiver1.ino
Here's the output:
A9 10101001 FA 11111010 7C 01111100 FC 11111100 1B 00011011 7E 01111110 FD 11111101 1F 00011111 BF 10111111 FE 11111110 95 10010101
**The expected data is(correct one, as per RTL_SDR):
rainpoint_decode: : {96} aa 81 06 03 9f 04 02 20 07 00 4d 15**
Thus, I think it's the config parameters. I have no knowledge on this preamble, discarding bit...
I also try this one. It also can receive but wrong value:
https://github.com/mathertel/rfcodes/blob/4eec184ed6437ab8b7865591b04023a63dafbdaa/examples/TempSensor/TempSensor.ino
Any suggestion?
Thanks;

Related

Hex editing rom game

I'm a totally noob on this thing. I need to edit a file with an hex editor.
-At offset 0x2E27EE
put this code:
80 21 09 02 09 22 12 06 9F 44 11 80 03 49 C3 02 C9 18 11 80 70 47 FE FF FF 01 00 00 00 00 30 B5 91 B0 68 46 00 F0 F3 F8 6D 46 01 35 06 4A AA 20 00 00 05 49 55 20 00 00 90 20 00 00
-At offset 0x5E4BD2:
put this code:
C1 DD E3 D7 D5 00 D9 00 BE DD EA D9 E6 E8 DD E8 DD 00 5C D6 ED 00 BB E2 E9 D6 DD E7 5D FB CC E3 E1 00 CC DD E4 E4 D5 E8 D5 00 D8 D5 00 CE DC D9 BF E2 E8 00 D9 00 BB E2 E9 D6 DD E7 FE E4 D9 E6 00 E4 E3 DF D9 E1 E3 E2 E1 DD E0 E0 D9 E2 E2 DD E9 E1 AD D7 E3 E1 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
Opening the file i can't search for that.
img
I know that I'm doing something wrong.. can you tell me what? Thanks.

How to find algorithm to calculate 2 bytes of checksum from CAN message KIA auto

Can anyone tell me the algorithm to calculate checksum (B0 B1) of the KIA AUTO CAN Mesage, how it is calculated from other byte?
algorithm to calculate 2 bytes of checksum from CAN mesage
ID DLC CRC Data Bytes
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15
03A0 16 F4 7B 2D 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 B9 93 2E 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 9D 3B 2F 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 8D 61 30 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 A9 C9 31 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 E4 21 32 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 C0 89 33 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 5F E1 34 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 7B 49 35 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 36 A1 36 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 12 9 37 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 08 70 38 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 2C D8 39 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 61 30 3A 00 FF FF FF FF 00 00 00 00 00 00 00 00
03A0 16 45 98 3B 00 FF FF FF FF 00 00 00 00 00 00 00 00

Reading a .byt file into R

Gridded daily Near-Surface Wind Speed data from this source has file extensions .byt which I am unfamiliar with.
I am attempting to read this data into R for analysis, and so would like to interrogate it by latitude and longitude.
I have tried to import it into R and explore the data through the terminal but cannot seem to find a way to get the full dataset into R and subsequently into a useful format.
So far, I have the following:
to.read = file("~/Near-Surface_Wind_Speed/mcvicar_etal_grl2008/5km/2018/Aust_Wind_5km_20180101_V2.byt", "rb")
readBin(to.read, integer(), n=5, size=2, endian = "little")
But this only gives me 5 values and no metadata (i.e. variable names or coordinates)
As I am using a mac, I then opened the terminal and tried the following command:
od -t x1 Aust_Wind_5km_20180101_V2.byt
which returned a bigger picture of the data, a subset of which is given here:
0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0001740 ff ff ff ff ff ff ff ff ff ff 0b 0b 0b 0c 0c 0c
0001760 0c 0c 0c 0c 0c 0c 0c 0c 0c 0d ff ff ff ff ff ff
0002000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0002060 ff 11 ff ff 11 10 10 10 10 11 11 11 11 11 11 11
0002100 11 11 11 12 ff ff ff ff ff ff ff ff ff ff ff ff
0002120 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0002660 ff ff 19 ff ff ff ff ff ff ff ff ff ff ff ff ff
0002700 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0003020 ff ff ff 19 18 18 19 14 13 13 13 13 13 13 13 13
0003040 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14
0003060 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 19
0003100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0003120 ff ff ff ff 1a 14 15 15 15 15 18 ff ff ff ff ff
0003140 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0003460 ff ff ff 0c 0a 08 08 08 08 08 08 08 08 08 08 08
0003500 09 0c 0e ff ff ff ff ff ff ff ff ff ff ff ff ff
0003520 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0003560 ff ff ff ff ff ff ff ff ff ff ff ff ff 11 10 0b
0003600 0b 0b 0b 0b 0c 0c 0c 0d 0d 0d 0d 11 12 ff ff ff
0003620 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0004340 ff ff ff ff ff ff ff ff ff ff ff ff 19 15 ff ff
0004360 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0004520 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 19
0004540 ff 15 12 12 15 19 19 17 14 10 0d 0d 0d 0e 0e 10
0004560 13 0f 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e
0004600 0e 0e 0e 0e 0f 0f 0f 0f 13 17 18 18 19 ff ff ff
0004620 ff ff ff ff ff ff ff ff ff ff ff ff ff 1a 18 16
0004640 15 12 14 1a ff ff ff ff ff ff ff ff ff ff ff ff
0004660 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0005160 ff ff ff ff ff ff ff ff ff ff ff ff ff 0c 0b 08
0005200 07 07 07 07 06 08 09 08 09 0b 0e ff ff ff ff ff
0005220 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0005300 11 ff ff ff ff 11 10 0d 09 08 08 0a 0d 11 11 12
0005320 12 12 12 12 12 ff ff ff ff ff ff ff ff ff ff ff
0005340 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0006060 ff ff ff ff ff 19 15 ff 19 19 ff ff ff ff ff ff
0006100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0006240 ff ff ff ff ff ff ff ff ff ff 19 19 19 ff ff ff
0006260 ff ff 15 11 11 13 15 13 17 19 14 0e 0e 0e 11 0f
0006300 0e 0e 0e 10 13 13 13 13 13 13 13 13 13 13 13 13
0006320 10 0f 0f 10 10 14 14 17 1a ff ff ff ff ff ff ff
0006340 ff ff ff ff ff ff ff ff ff ff 1a 17 ff ff ff ff
0006360 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0006700 ff ff ff ff ff ff ff 0d 0b 0b 0a 0a 09 09 0b 0d
0006720 0c 0d 0e ff ff ff ff ff ff ff ff ff ff ff ff ff
0006740 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0007000 ff ff ff ff ff ff ff ff 11 11 11 11 11 10 0e 0c
0007020 0a 09 09 0b 0d 11 12 ff ff ff ff ff ff ff ff ff
0007040 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0007600 19 12 15 ff ff ff ff ff ff ff ff ff ff ff ff ff
0007620 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0007760 ff ff ff ff ff ff ff ff ff ff ff ff 19 19 19 ff
0010000 ff ff ff 16 13 13 11 0e 10 11 14 12 0f 0e 0f 0e
0010020 0e 10 13 15 14 14 13 15 18 17 14 11 11 10 0f 0f
0010040 10 15 1a ff ff 1a ff ff ff ff ff ff ff ff ff ff
0010060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0010420 ff 0d 0d 0d 0d 0d 0c 0d ff 0e ff ff ff ff ff ff
0010440 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0010520 11 11 ff 11 10 0c 0b 0a 09 09 0b 0e 10 11 12 ff
0010540 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0011300 ff ff ff ff ff ff ff ff ff ff 19 ff ff ff ff ff
0011320 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0011500 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 18
0011520 15 18 1a ff 1a 17 13 11 14 12 0f 0f 0f 0f 0e 0e
0011540 0f 11 13 16 18 17 16 13 13 0f 10 13 14 14 14 17
0011560 16 ff ff ff ff 1a 1a ff ff ff ff ff ff ff ff ff
0011600 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
As this data type is very new to me, this is difficult to produce a reproducible question. Any comments to this effect are very welcome...
#VincentGuillemot in the comment below directed me to a meta data file which shows the following information:
clc; clear all;
% Lower left = 112.000, -44.000 [111.975, -44.025]
% Upper right = 154.000, -10.000 [154.025, -9.975]
% Number of columns = 841
% Number of rows = 681
rows=681; cols=841;
filename = 'Aust_Wind_5km_20110528_V2.byt';
M = memmapfile(filename,'Format',{'uint8',[cols rows],'x'});
a=M.Data.x;
a = a./15.875;
A=flipud(rot90(a));
imagesc(A);
It seems like this may be helpful in determining how many items to read into each row/column in R.
As I struggled to find an answer to this I thought I would post my solution for the aforementioned dataset.
Using the information provided in the metadata file as pointed out by #Vincent Guillemot we can see there are 841 rows and 681 columns with given bounds for lat and long.
So we can read it in using readBin where n=(681*841).
to.read = file("~/Dropbox/DataSets/Near-Surface_Wind_Speed/mcvicar_etal_grl2008/5km/2018/Aust_Wind_5km_20180101_V2.byt", "rb")
wind <- readBin(to.read, integer(),n=(681*841),size=1,endian="little")
close(to.read)
Then using the data.table package for speed we can give the table a lat and long column and then plot using ggplot2
library(data.table)
library(ggplot2)
windDT <- as.data.table(wind)
windDT$longitude <- rep(seq(112,154,by=0.05),681)
windDT$latitude <- rep(seq(-10,-44,by=-0.05),each=841)
windDT[wind < 0]$wind = NA
ggplot(windDT,aes(longitude,latitude))+
geom_raster(aes(fill=wind))+
scale_fill_continuous(na.value="transparent")+
coord_fixed(ratio = 1)+
theme_bw()

Get jpg from UDP hex dump with wireshark

I am trying to take part in a CTF challenge. I have a pcap file of a jpg file transfer. I know that the jpg starts with FF D8 FF and ends with FF D9.
The problem is that I have no idea how to extract the file itself.
The file is in here:
00000226 67 0d 0a 0d 0a ff d8 ff e0 00 10 4a 46 49 46 00 g....... ...JFIF.
00000236 01 01 00 00 01 00 01 00 00 ff db 00 43 00 03 02 ........ ....C...
..
00015617 d2 51 95 15 f7 e1 c0 d8 e9 6d 58 c8 07 71 c7 40 .Q...... .mX..q.#
00015627 3a 79 53 19 33 54 00 05 b4 92 07 33 5e af 54 2d :yS.3T.. ...3^.T-
00015637 1f ff d9 ...
As you can see it's mixed with 67 0d 0a 0d and the other information. I tried to copy the relevant parts and cut out the offset and ascii (?) section left and right with python and then imported the hexdump to this site to create a jpg of the hex dump.
Unfortunately that didn't work. The resulting image is extremely distorted and I can't read anything on it.
Does anyone have an advice? Not a full solution, just a tip so I can wrap my head around it myself.
Thanks.

Are there any standard protocols to transfer medical data?

Hello Every one
I'm currently working on a project that takes data from patients monitors and send them to another system that we built (Not the central station -which display all monitors- which is already working but it is closed source.).
The monitor is supplied with an Ethernet card and it sends data over the UDP protocol. But when we need to read real data which is in the application layer we understand nothing.
Here is a small frame we get from the traffic when the monitor talks to the central station.
0000 ff ff ff ff ff ff 66 76 84 00 18 73 08 00 45 00
0010 00 2e 00 00 40 00 40 11 7a 03 c0 a8 00 14 ff ff
0020 ff ff a4 10 1f 42 00 1a 04 45 ff d0 00 02 00 fe
0030 00 0a 32 01 02 03 04 05 0b 32 33 50
When I but it on wireshark it analyze until the UDP protocol and stop, it doesn't understand the application layer data.
Here is a sample application layer data.
ff d0 00 02 00 fe 00 0a 32 01 02 03 04 05 0b 32 33 50
Another one:
ff da 7f f1 00 04 00 0c 02 18 0d 0f 60 0c 04 0b 0b 10 00 00
Are there any standard protocols that used in medical field to transport data like ECG, respiration, etc.? And is there a protocol that is compatible with the form above?
Please stop there!
Get the specification or documentation from the vendor and do not reverse engineer the protocol. If you are unable to do so, leave this thing alone.
If you get it wrong you are endangering patients. Doctor may rely on your information which you are guessing as it seems.
Even if it something well documented like HL7 oder DICOM read the documentation and talk with the vendor.
Depending on jurisdiction there may be a myriad of legal problems ahead.
It may be transmitting in HL7
http://www.hl7.org/index.cfm

Resources