B4R Question B4R actual Version and rOneWire

Hello,
I'm in the process of revising an older application and have encountered the following issue with Dallas sensors and rOneWire:
The same code and hardware compiled with an older version of Arduino/B4R works fine

When compiled with the current B4R version,
it tells me there are no sensors (same hardware and code)

Does anyone have any advice?
Is there a newer Version for rOneWire as 2016 ?

Thanks for any advice
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,
I can confirm the issue reported by testing a DS1820b device connected to an ESP32-Wroom pin D4.

Working on a newer library version rOneWireEx which uses the latest installed OneWire library (via the Arduino IDE).
Added new function ReadTemperature. Will add some more functions as well.

Test Code
B4X:
Sub Process_Globals
    Private VERSION As String = "rOneWireEx DS1820b v20260824"
    Public Serial1 As Serial
    Private Sensor As OneWireEx
    Private SENSOR_PIN As Byte = 4
    Private Address(8) As Byte
    Private bc As ByteConverter
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log(CRLF, "[AppStart]", VERSION)
    ' Init onewire device
    Sensor.Initialize(SENSOR_PIN)
    If ReadAddress Then
        Dim t As Float = Sensor.ReadTemperature(Address)
        Log("[ReadTemperature] ", t)
        '[ReadTemperature] 18.6250
    End If
End Sub

Private Sub ReadAddress As Boolean
    Sensor.ResetSearch
    If Sensor.Search(Address) Then
        '[ReadAddress] 28330A9497040373 (8-Bytes)
        Log("[ReadAddress] ", bc.HexFromBytes(Address))
        Return True
    Else
        Log("[ReadAddress][E] No OneWire device found! Check wiring.")
        Return False
    End If
End Sub


[EDIT 2026-08-26]
rOneWireEx published. Attached library beta version deleted from this post.
 
Last edited:
Upvote 0
Hi,
I can confirm the issue reported by testing a DS1820b device connected to an ESP32-Wroom pin D4.

Working on a newer library version rOneWireEx which uses the latest installed OneWire library (via the Arduino IDE).
Added new function ReadTemperature.
Will add some more functions as well.

Give a go...final version will be posted in the B4R libraries folder.

Test Code:

B4X:
Sub Process_Globals
    Private VERSION As String = "rOneWireEx DS1820b v20260824"

    ' Communication
    Public Serial1 As Serial
   
    ' Sensor
    Private Sensor As OneWireEx
    Private SENSOR_PIN As Byte = 4
    Private Address(8) As Byte
   
    'Helper
    Private bc As ByteConverter
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log(CRLF, "[AppStart]", VERSION)

    ' Init onewire device
    Sensor.Initialize(SENSOR_PIN)
    If ReadAddress Then
        Dim t As Float = Sensor.ReadTemperature(Address)
        Log("[ReadTemperature] ", t)
        '[ReadTemperature] 18.6250
    End If
End Sub

Private Sub ReadAddress As Boolean
    Sensor.ResetSearch
    If Sensor.Search(Address) Then
        '[ReadAddress] 28330A9497040373 (8-Bytes)
        Log("[ReadAddress] ", bc.HexFromBytes(Address))
        Return True
    Else
        Log("[ReadAddress][E] No OneWire device found! Check wiring.")
        Return False
    End If
End Sub
Thanks, i have try it and It seems to be working without any problems.
 
Upvote 0
Top