Query SDK version number at runtime

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Query SDK version number at runtime

Post by jms » Thu Jun 30, 2016 2:48 pm

How does one find out what versions of the SDK is present short of guessing from what's in this forum (which suggests 1.5.2) ?

I have gone through the members/methods of esp, machine and sys but can't find anything.
Last edited by jms on Fri Jul 01, 2016 6:45 am, edited 2 times in total.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Building ESP8266 port - tips, tricks, and updates

Post by Roberthh » Thu Jun 30, 2016 4:19 pm

A safe method is brute force: delete the esp-open-sdk from your system and reinstall it using following the directions in https://github.com/micropython/micropyt ... /README.md.

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: SDK version number at runtime

Post by jms » Fri Jul 01, 2016 5:34 am

I see my question has been moved here.

I wasn't clear. I mean at runtime. I believe mine is almost certainly 1.5.2 but it really ought to be possible to query it.

For that matter it would be good to be able to find out the commit hash of micropython itself.

Jon

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Query SDK version number at runtime

Post by pfalcon » Fri Jul 01, 2016 10:46 am

os.uname() will give the vendor SDK version as a "release" field. As for the building requirements, they are specified in http://forum.micropython.org/viewtopic.php?f=16&t=1689 .
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: Query SDK version number at runtime

Post by jms » Fri Jul 01, 2016 11:54 am

You are right

Code: Select all

>>> os.uname()
(sysname='esp8266', nodename='esp8266', release='1.5.4(baaeaebb)', version='v1.8.1-58-g7053621 on 2016-06-17', machine='ESP module with ESP8266')
I didn't think of checking the standard function uname(). I appear to have 1.5.4 .

Now I've worked it out (git-describe was new to me) 7053621 is a git hash and the 58 the number of commits since tag 1.8.1 .

Post Reply