# Xbee 3 micropython

**URL:** <https://forums.digi.com/t/xbee-3-micropython/38324>\
**Category:** XBee & XBee Gateway\
**Tags:** micropython, xbee-3\
**Created:** [April 8, 2026, 2:02pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324 "2026-04-08T14:02:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozgun](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@ozgun](https://forums.digi.com/u/ozgun)\
**Post date:** [April 8, 2026, 2:02pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/1 "2026-04-08T14:02:55Z")

</div>

I am unable to use the python module math on the xbee via the Xbee plugin of pycharm.

I have created a new xbee micropython project using the Digi Xbee plugin of pycharm.  
Everything works fine.

Then I wanted to use the Math module, the project builds fine because it is in the xbee library and also in the standard python modules included in the project.

But when I deploy the code to the xbee 3 module via the Digi Xbee plugin of pycharm, I do not see the math module deployed.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/digi/original/2X/8/897c5f94a4ce5a6e4e7fb422a0931bed655fba09.png)

So the app crashes at execution time.

```auto
>>>

soft reboot
Loading /flash/main.mpy…
Running bytecode…
Traceback (most recent call last):
File “/flash/main.py”, line 2, in 
ImportError: no module named ‘math’

MicroPython v1.20.0-1893-gc1d0c0d on 2025-01-15; XBee3 Zigbee with EFR32MG
Type “help()” for more information.
>>>

```

How can we use the micropython math module on the xbee3 module ?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [April 8, 2026, 2:43pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/2 "2026-04-08T14:43:59Z")

</div>

The XBee modules do not directly support the module math.

help(‘modules’)  
**main** micropython uhashlib ustruct  
ble uarray uio usys  
builtins ubinascii ujson utime  
digi ucryptolib umachine xbee  
gc uerrno uos  
Plus any modules on the filesystem

You would need to manually load the Math module.

---

<div class="post-metadata">

**Author:** ![ozgun](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@ozgun](https://forums.digi.com/u/ozgun)\
**Post date:** [April 8, 2026, 3:26pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/3 "2026-04-08T15:26:38Z")

</div>

Thanks for the reply.  
Can you please guide me to do that ?  
Since the micropython distribution is handled by the pycharm digi xbee plugin, I do not know how to add a single module manually.  
Sorry I am kindy new to micropython.  
Thanks a lot in advance.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [April 8, 2026, 3:36pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/4 "2026-04-08T15:36:37Z")

</div>

Probably the best way is to import the file into the Lib directory of your project. Then when you compile and upload the app, it should send it to the Lib directory of the module. If that does not work, you can use the file system manager in XCTU or Studio. Then Brows to the directory you have it on your PC and drag it over to the \lib directory on the module.

---

<div class="post-metadata">

**Author:** ![ozgun](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@ozgun](https://forums.digi.com/u/ozgun)\
**Post date:** [April 8, 2026, 8:36pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/5 "2026-04-08T20:36:25Z")

</div>

Thanks again for your reply.  
Should I copy the math.py file which is in /ExternalLibraries/Python3.14/BinarySkeletons/ ?  
of the math.pyi which is in /ExternalLibraries/XbeeMicropython/digimicropython/ ?

Also where should I copy it ? in the Lib folder of /.venv/ ?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/digi/original/2X/3/3a27646cf888eb8fd948e20e4a481d0d0629df3e.png)

---

<div class="post-metadata">

**Author:** ![ozgun](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@ozgun](https://forums.digi.com/u/ozgun)\
**Post date:** [April 8, 2026, 9:44pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/6 "2026-04-08T21:44:04Z")

</div>

I tried both.  
Copying in the .venv/Lib folder does not make the module deployed on the xbee.

I used XCTU filesystem support and copied the math files (tried both from xbee lib and standard python), but they both requires other standard python modules that are not present on the xbee flash (collections, typing, inf, nan, ect…). I did not try to copy them as well since they migh require further dependencies.  
So does not work either ☹

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [April 9, 2026, 11:52am UTC](https://forums.digi.com/t/xbee-3-micropython/38324/7 "2026-04-09T11:52:47Z")

</div>

Ozgun, Which Digi product and firmware are you working with?

---

<div class="post-metadata">

**Author:** ![ozgun](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@ozgun](https://forums.digi.com/u/ozgun)\
**Post date:** [April 9, 2026, 4:15pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/8 "2026-04-09T16:15:05Z")

</div>

Hi Eric,  
I work with xbee 3 modules with product ref: XB3-24Z8PT-J and firmware version: 1014.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/digi/original/2X/1/1d6d8e696dad74b585daef8f7ab07af52be799ba.png)

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [April 9, 2026, 5:08pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/9 "2026-04-09T17:08:27Z")

</div>

The Math module is not currently supported.

---

<div class="post-metadata">

**Author:** ![ozgun](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@ozgun](https://forums.digi.com/u/ozgun)\
**Post date:** [April 9, 2026, 6:18pm UTC](https://forums.digi.com/t/xbee-3-micropython/38324/10 "2026-04-09T18:18:52Z")

</div>

Are there other xbee modules that supports it ?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [April 10, 2026, 11:55am UTC](https://forums.digi.com/t/xbee-3-micropython/38324/11 "2026-04-10T11:55:57Z")

</div>

No, none of the XBee modules at this time directly support the math module.
