0

I am trying to make a post request to the firebase but I am facing an error that has not occurred before with the same code. My internet connection is through a 2G-Modem on my embbedded linux (Ubuntu 16.04) device (Orange Pi 2g IoT) and I had no problem so far by running a Python 2.7 script on it and posting the URL. But now suddenly I started experiencing the following error as I execute my code:

root@OrangePi:~# [ 5218.307887] rc.local[395]: Traceback (most recent call last):
[ 5218.308805] rc.local[395]:   File "/root/TEST/Timekeeper.py", line 38, in <module>
[ 5218.309607] rc.local[395]:     send_event = firebase.post('/device', new_event)
[ 5218.310542] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.
[ 5218.311748] rc.local[395]:     return f(*args, **kwargs)
[ 5218.312254] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/firebase.py
[ 5218.314531] rc.local[395]:     connection=connection)
[ 5218.315074] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.
[ 5218.315506] rc.local[395]:     return f(*args, **kwargs)
[ 5218.315895] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/firebase/firebase.py
[ 5218.317208] rc.local[395]:     timeout=timeout)
[ 5218.317692] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.320210] rc.local[395]:     return self.request('POST', url, data=data, json=json, **kwargs
[ 5218.320780] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.321206] rc.local[395]:     resp = self.send(prep, **send_kwargs)
[ 5218.322444] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.324416] rc.local[395]:     r = adapter.send(request, **kwargs)
[ 5218.325043] rc.local[395]:   File "/usr/local/lib/python2.7/dist-packages/requests-2.18.4-py2.
[ 5218.325572] rc.local[395]:     raise SSLError(e, request=request)
[ 5218.325990] rc.local[395]: requests.exceptions.SSLError: HTTPSConnectionPool(host='hermes-4dc8ror(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),)

The part of the code that generates this error is the following:

from firebase import firebase

firebase_url = 'https://hermes-4dc8c.firebaseio.com/'
firebase = firebase.FirebaseApplication(firebase_url, None)

new_event = {

     "eventType": "Sirene"


  }

send_event = firebase.post('/device', new_event)

This embbedded device called Orange Pi 2g IoT has its own modem 2G to connect to internet but I am not sure what kind of certification this thing has at all since it is $10, is it possible that Firebase blocked my device due to unknown or strange connection origin?. Have anyone had this issue before here or can help me out with this?

Thanks, guys!!

Lucas Bastos
  • 99
  • 2
  • 11

2 Answers2

1

This happens because of low network connection either from your internet speed or firebase. Check the status of Firebase when that happens. More explanation here.

shaud
  • 25
  • 6
0

It might be an issue due to timing mismatch on the device. Try correcting the time on the device using following command.

sudo date -s "Fri Nov 26 11:19:00 UTC 2021"
Kakarot
  • 45
  • 4