B4R Question Does the arduino board have a serial number?

Erel

B4X founder
Staff member
Licensed User
Longtime User
Install this library with Arduino IDE libraries manager: https://github.com/ricaun/ArduinoUniqueID

B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private ID(8) As Byte
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    RunNative("getid", Null)
    Dim bc As ByteConverter 'rRandomAccessFile library
    Log(bc.HexFromBytes(ID))
End Sub

#if C
#include <ArduinoUniqueID.h>

void getid (B4R::Object* o) {
 for(size_t i = 0; i < 8; i++)
   ((Byte*)b4r_main::_id->data)[i] = UniqueID8[i];
}
#End If

ESP8266 / ESP32 MAC address: https://www.b4x.com/android/forum/threads/how-to-use-global-arrays-from-inline-c.68747/post-436143
 
Upvote 0

vali khandangoll

Active Member
Install this library with Arduino IDE libraries manager: https://github.com/ricaun/ArduinoUniqueID

B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private ID(8) As Byte
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    RunNative("getid", Null)
    Dim bc As ByteConverter 'rRandomAccessFile library
    Log(bc.HexFromBytes(ID))
End Sub

#if C
#include <ArduinoUniqueID.h>

void getid (B4R::Object* o) {
 for(size_t i = 0; i < 8; i++)
   ((Byte*)b4r_main::_id->data)[i] = UniqueID8[i];
}
#End If

ESP8266 / ESP32 MAC address: https://www.b4x.com/android/forum/threads/how-to-use-global-arrays-from-inline-c.68747/post-436143
I could not create XML file.
is it possible you create xml file ?
 

Attachments

  • Untitled.png
    Untitled.png
    74.4 KB · Views: 195
Upvote 0
Top