enable_uart=1
pi
and password raspberry
ifconfig
(The ether value is the MAC address)sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="Tufts_Wireless"
key_mgmt=NONE
}
sudo shutdown -r now
For more detailed instructions on setting up your Raspberry Pi through the USB to Serial Converter visit http://lctronics.org/rpi-setup.html
ifconfig wlan0
(The IP address appears after inet)sudo raspi-config
, Select Interfacing Options, and enable the SSH serverssh-keygen -R <IP>
on your local machinessh pi@<IP>
(replace <IP>
with the Pi's IP address)sudo apt-get install python-pip
pip install requests
mkdir Thingworx
nano write.py
import requests
import json
# Info
url = "http://pp-1804271345f2.portal.ptc.io:8080/Thingworx/Things/CEEO_Summer/Properties/"
headers = {
'appKey': "<your appkey here>",
'Accept': "application/json",
'Content-Type': "application/json"
}
propName =raw_input("Enter Property: ")
value=raw_input("Enter Value: ")
propValue = {propName: value}
# Put
requests.request("PUT",url+'*',headers=headers,json=propValue)
# Get (validate value was posted)
getResponse=requests.request("GET",url+propName,headers=headers)
parsed_json = json.loads(getResponse.text)
if set(parsed_json['rows'][0][propName]) == set(value):
print('Property Value Updated')
else:
print('Property Value was not updated')
python write.py
nano read.py
import requests
import json
# Info
url = "http://pp-1804271345f2.portal.ptc.io:8080/Thingworx/Things/CEEO_Summer/Properties/"
headers = {
'appKey': "<your appkey here>",
'Accept': "application/json",
'Content-Type': "application/json"
}
propName =raw_input("Enter Property: ")
# Get
getResponse=requests.request("GET",url+propName,headers=headers)
parsed_json = json.loads(getResponse.text)
print(('Property Value: ')+(parsed_json['rows'][0][propName]))
More API calls can be made with python. The syntax for these calls are available at https://documenter.getpostman.com/view/478773/2SKqo9
sudo apt-get update
sudo apt-get install matlab-rpi
sudo matlab-rpi-setup
For projects that require analog pins, you can connect the Arduino through a serial connection and control it as a slave.
Resources: https://pypi.org/project/nanpy/ , https://www.youtube.com/watch?v=QumIhvYtRKQ
sudo apt-get install arduino -y
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install git
git clone https://github.com/nanpy/nanpy-firmware.git
cd nanpy-firmware
./configure.sh
cd Nanpy
nano cfg.h