File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1818 print ("WiFi secrets are kept in secrets.py, please add them there!" )
1919 raise
2020
21- # Get device certificate and private key from a certificates.py file
21+ # Get device certificate
2222try :
23- from certificates import DEVICE_CERT , DEVICE_KEY
23+ with open ("aws_cert.pem.crt" , "rb" ) as f :
24+ DEVICE_CERT = f .read ()
2425except ImportError :
25- print ("Certificate and private key data is kept in certificates.py, \
26- please add them there!" )
26+ print ("Certificate (aws_cert.pem.crt) not found on CIRCUITPY filesystem." )
27+ raise
28+
29+ # Get device private key
30+ try :
31+ with open ("private.pem.key" , "rb" ) as f :
32+ DEVICE_KEY = f .read ()
33+ except ImportError :
34+ print ("Certificate (private.pem.key) not found on CIRCUITPY filesystem." )
2735 raise
2836
2937# If you are using a board with pre-defined ESP32 Pins:
Original file line number Diff line number Diff line change 1818 print ("WiFi secrets are kept in secrets.py, please add them there!" )
1919 raise
2020
21- # Get device certificate and private key from a certificates.py file
21+ # Get device certificate
2222try :
23- from certificates import DEVICE_CERT , DEVICE_KEY
23+ with open ("aws_cert.pem.crt" , "rb" ) as f :
24+ DEVICE_CERT = f .read ()
2425except ImportError :
25- print ("Certificate and private key data is kept in certificates.py, \
26- please add them there!" )
26+ print ("Certificate (aws_cert.pem.crt) not found on CIRCUITPY filesystem." )
27+ raise
28+
29+ # Get device private key
30+ try :
31+ with open ("private.pem.key" , "rb" ) as f :
32+ DEVICE_KEY = f .read ()
33+ except ImportError :
34+ print ("Certificate (private.pem.key) not found on CIRCUITPY filesystem." )
2735 raise
2836
2937# If you are using a board with pre-defined ESP32 Pins:
You can’t perform that action at this time.
0 commit comments