Difference between revisions of "Micropython Bluemix"

From wiki.emacinc.com
Jump to: navigation, search
Line 8: Line 8:
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /****************************************  Page Description Text  ****************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
Micropython is an implementation of the Python 3 programming langauge optimized to run on microcontrollers in a constrained environment.
+
Bluemix is a cloud computing service developed by IBM.
  
Micropython requires only 256k of code space and 16k RAM and aims to be as compatible as possible with normal Python 3 to allow for easy portability from desktop to microcontroller.
+
Bluemix has the capabilities to host a variety of services from web services to crypto-currencies.
 +
 
 +
This Wiki contains information on how to use the methods that EMAC has developed for Micropython to interact with IBM Bluemix IoT.
  
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*****************************************  Using/Working With  ******************************************/ -->
 
<!-- /*****************************************  Using/Working With  ******************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
 
<!-- /*********************************************************************************************************/ -->
{{:Templateimpl:using | initials=BS | title=EMAC Micropython with IBM Bluemix | desc=The following page can be used to get familiarized with Micropython on EMAC products. | project=OE 5.0 }}
+
{{:Templateimpl:using | initials=BS | title=EMAC methods for Micropython with IBM Bluemix | desc=The following page can be used to get familiarized with Micropython on EMAC products. | project=OE 5.0 }}
 +
*class Bluemix:
 +
**This class provides a tailored interface to the MQTTClient class, for the purpose of connecting to the IBM Bluemix IoT service. It is imported from the 'bluemix' module. The following is an example usage.
 +
**<syntaxhighlight lang=python>
 +
client = bluemix.Bluemix(ORG, DEVICE_ID, DEVICE_TYPE, AUTH_TOKEN)
 +
client.connect()
 +
msg = '{d:{value:"42"}}'
 +
client.publish('desired/topic/to/use', msg)
 +
</syntaxhighlight>

Revision as of 13:44, 5 June 2018

Bluemix is a cloud computing service developed by IBM.

Bluemix has the capabilities to host a variety of services from web services to crypto-currencies.

This Wiki contains information on how to use the methods that EMAC has developed for Micropython to interact with IBM Bluemix IoT.

EMAC methods for Micropython with IBM Bluemix

  • class Bluemix:
    • This class provides a tailored interface to the MQTTClient class, for the purpose of connecting to the IBM Bluemix IoT service. It is imported from the 'bluemix' module. The following is an example usage.
    • client = bluemix.Bluemix(ORG, DEVICE_ID, DEVICE_TYPE, AUTH_TOKEN)
      client.connect()
      msg = '{d:{value:"42"}}'
      client.publish('desired/topic/to/use', msg)