Getting MAC address of unconnected Core

I’m on a school network which requires that I register devices by their MAC address. Is there a way I can get this for my Core, without already being connected to the internet?

You will have to flash a core with the code to print out the mac address via Serial in SYSTEM_MODE(MANUAL) and write it down.

The quick way i can think of is to connect it to your mobile hotspot and you will see the mac address :wink:

1 Like

I ran into a similar problem at my college. I ended up doing what @kennethlimcp suggested and set each up using a hotspot, flashing custom firmware that exposed the MAC address, and then registering them to my school’s wifi

Thanks for the quick replies.
Just to document the steps for the next poor person in this situation:

Install tools

  • dfu-util 0.7 (I’m on Ubuntu 14.04, so this necessitated installing autoconf and libusb-1.0-0-dev, cloning the source, building and installing it.)
    sudo apt-get install autoconf libusb-1.0-0-dev
    git clone https://github.com/siemens/dfu-util.git
    ./autogen.sh
    ./configure
    make
    sudo make install

  • Spark command-line utilities (I had to install nodejs-legacy for the build/install to work)
    sudo apt-get install nodejs-legacy
    sudo npm install -g spark-cli

Flash the code

  • Go to the web IDE

  • Paste in the code here: https://gist.github.com/stevenbell/5ffcf985957e26442810

  • Save the program, then click the “compile and download” button

  • The file “firmware.bin” will be offered as a download; put it somewhere.

  • Put the Core in DFU mode (instructions here)

  • Run the command to flash the Core:
    sudo spark flash --usb firmware.bin

  • Open a serial monitor and get the MAC from the output

2 Likes

Hi,

At my office, MAC address must be registered to router before connecting.
I’ve tried connecting a core that had never been connected to WIFI before with proposed method. It never worked, returned MAC was always 0.0.0.0.0. I’ve updated cc3000, deep_update… no success.
I got a second spark and connected it successfully at home. After I ran sketch returning MAC address at office : its MAC address was returned.
So it seems impossible to get mac address of a spark core that has never been connected to WIFI. I haven’t yet dug into code.

lah

You can still connect to any Wifi network and print out the mac address using: https://docs.particle.io/reference/firmware/core/#wifi-macaddress-

In the case where I only have access to a wifi network where MAC address must be given to router and other available wifi’s credentials are not known given code (just tested):

  • won’t be called! as I’m in automatic mode, so GREEN led will always blink
  • if run it in manual mode, it will return 0.0.0.0.0 mac
    So now, I have not found any mean to get mac address “offline”.

You could run access point software like virtualrouter on a laptop or something like a $69 winbook and watch for the MAC.

I can see there is a need to get access to the MAC address before everything else, therefore, it would make sense to make available this information on the product packaging. It would make all our lives form experiment to industrial deployment much more easier and happy :smile:

@edwintam that would be a great use but a logistics nightmare. :smiley:

How about being able to retrieve it via Serial in Listening mode? Like how the core id is retrieved now

Guess that would do, at least then it can be carried out pretty easily by the field engineers.

@mdma,

should we somehow extend the s to eventually have a full device information printed out?

Sure. although keep in mind that s is for M2M rather than H2M. For readable output, we have m for the mac address.

1 Like

^^ :+1: totally forgot about that m command :smiley: