-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update dan, dai. change cumstom format * Update README.rst
- Loading branch information
Showing
6 changed files
with
290 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,40 @@ | ||
ArduinoYun DA for IoTtalk v2 | ||
============================ | ||
For iottalk v2 client, you have to install ``paho-mqtt``. Remember to install version 1.4.0: https://pypi.org/project/paho-mqtt/1.4.0/. | ||
|
||
.. code-block:: | ||
wget https://files.pythonhosted.org/packages/25/63/db25e62979c2a716a74950c9ed658dce431b5cb01fde29eb6cba9489a904/paho-mqtt-1.4.0.tar.gz | ||
pip install paho-mqtt-1.4.0.tar.gz | ||
To use this code, only ``custom.py`` needs to be modified. | ||
This code uses device model ``MCU_board`` as an example, that is, the IDFs/ODFs are | ||
|
||
.. code-block:: python | ||
def odf(): # int only | ||
return [ | ||
('D2', 0, 'D2'), #ODF_name, dimension, Variable_name in Bridge | ||
('D3', 0, 'D3'), | ||
('D4', 0, 'D4'), | ||
('D5~PWM', 0, 'D5~PWM'), | ||
('D6~PWM', 0, 'D6~PWM'), | ||
('D7', 0, 'D7'), | ||
('D8', 0, 'D8'), | ||
('D9~PWM', 0, 'D9~PWM'), | ||
def odf(): | ||
return [ # ('odf_name', (param_strings in tuple)) | ||
('D2-O', ('int', )), | ||
('D3-O', ('int', )), | ||
('D4-O', ('int', )), | ||
('D5Pwm-O', ('int', )), | ||
('D6Pwm-O', ('int', )), | ||
('D7-O', ('int', )), | ||
('D8-O', ('int', )), | ||
('D9Pwm-O', ('int', )), | ||
] | ||
.. code-block:: python | ||
def idf(): | ||
return [ | ||
('A0', int), #IDF_name, Variable_type | ||
('A1', int), | ||
('A2', int), | ||
('A3', int), | ||
('A4', int), | ||
('A5', int), | ||
return [ # ('idf_name', (params in tuple)) | ||
(('A0-I', ('int', )), | ||
('A1-I', ('int', )), | ||
('A2-I', ('int', )), | ||
('A3-I', ('int', )), | ||
('A4-I', ('int', )), | ||
('A5-I', ('int', )), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
|
||
|
||
ServerIP = 'IoTtalk Ver. 2 Server IP' | ||
device_model ='MCU_board' | ||
api_url = 'IoTtalk Ver. 2 Server IP' | ||
device_model = 'MCU_board' | ||
device_name = None | ||
# device_addr = 'your device addr' | ||
username = None | ||
Comm_interval = 0.5 # unit:second | ||
push_interval = 0.5 # global interval | ||
|
||
def odf(): # int only | ||
def odf(): | ||
return [ | ||
('D2', 0, 'D2'), | ||
('D3', 0, 'D3'), | ||
('D4', 0, 'D4'), | ||
('D5~PWM', 0, 'D5~PWM'), | ||
('D6~PWM', 0, 'D6~PWM'), | ||
('D7', 0, 'D7'), | ||
('D8', 0, 'D8'), | ||
('D9~PWM', 0, 'D9~PWM'), | ||
('D2-O', ('int', )), | ||
('D3-O', ('int', )), | ||
('D4-O', ('int', )), | ||
('D5Pwm-O', ('int', )), | ||
('D6Pwm-O', ('int', )), | ||
('D7-O', ('int', )), | ||
('D8-O', ('int', )), | ||
('D9Pwm-O', ('int', )), | ||
] | ||
|
||
def idf(): | ||
return [ | ||
('A0', int), | ||
('A1', int), | ||
('A2', int), | ||
('A3', int), | ||
('A4', int), | ||
('A5', int), | ||
] | ||
('A0-I', ('int', )), | ||
('A1-I', ('int', )), | ||
('A2-I', ('int', )), | ||
('A3-I', ('int', )), | ||
('A4-I', ('int', )), | ||
('A5-I', ('int', )), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.