# Retrieve a unique stable ID number from an Arduino

**URL:** <https://discourse.julialang.org/t/retrieve-a-unique-stable-id-number-from-an-arduino/50185>\
**Category:** Offtopic\
**Tags:** question, arduino\
**Created:** [November 15, 2020, 2:24pm UTC](https://discourse.julialang.org/t/retrieve-a-unique-stable-id-number-from-an-arduino/50185 "2020-11-15T14:24:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 15, 2020, 2:24pm UTC](https://discourse.julialang.org/t/retrieve-a-unique-stable-id-number-from-an-arduino/50185/1 "2020-11-15T14:24:53Z")

</div>

I’m using [LibSerialPort.jl](https://github.com/JuliaIO/LibSerialPort.jl) to communicate with an Arduino. I have 5 Arduinos connected at the same time, and I’d like to have a robust way of identifying which is which (regardless or restarts or switching the cables).

Right now I’ve programmed each Arduino to return an individual ID I manually assigned it (when queried for it). But I’m wondering if there is a way (using `LibSerialPort.jl`) to retrieve some such on-board ID number? This would save an if-statement on the Arduinos and this manual setting up.

Slightly related, does anyone know if it’s possible to programmatically load sketches to an arduino “from Julia” (on Linux)? This too would facilitate the process since I’d then be able to first load individual sketches with individual ID numbers (all programmatically generated) when setting up this whole thing.

---

<div class="post-metadata">

**Author:** ![jagot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jagot/32/12217_2.png) [@jagot](https://discourse.julialang.org/u/jagot)\
**Post date:** [November 15, 2020, 3:24pm UTC](https://discourse.julialang.org/t/retrieve-a-unique-stable-id-number-from-an-arduino/50185/2 "2020-11-15T15:24:58Z")

</div>

Maybe related:

> **[How to read the ID (serial number) of an Arduino?](https://forum.arduino.cc/t/how-to-read-the-id-serial-number-of-an-arduino/45214)**
>
> Hi all, Is there a way to retrieve the ID ( serial number on the sticker on the back of the Arduino, e.g. "CD1234") of an Arduino via code? I remember Phidgets offered that feature and i need it for my current feature. Suggestion for any means...

> **[How to get a unique ID for arduino board?](https://forum.arduino.cc/t/how-to-get-a-unique-id-for-arduino-board/427574)**
>
> In a project for creating a hardware lock, I need to get a unique ID. I use arduino mega 2560 R3 board. Does arduino boards have a built in unique ID? Or is there another chip for this purpose. It is possible to save an ID in EEPROM but it...

(apologies if you’ve seen these already)

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 15, 2020, 3:46pm UTC](https://discourse.julialang.org/t/retrieve-a-unique-stable-id-number-from-an-arduino/50185/3 "2020-11-15T15:46:08Z")

</div>

Yea… No worries. There isn’t much there in terms of how to do it from Julia. My current work around works though.
