Comments (4)
I suspect this is a really simple mistake on my part - due to my very limited understanding of working with APIs.
I changed your test program slightly to look at the general api. I can login, get information but I can't get an image. It looks like something is wrong with my Request object.
My setup is super simple. Computer and camera on are on the same PoE switch. The camera is an RLC-420-5MP.
python test_reolink.py
Login success
successfully created object: <class 'Camera.Camera'>
Getting General System: [{'cmd': 'GetTime', 'code': 0, 'initial': {'Dst': {'enable': 0, 'endHour': 2, 'endMin': 0, 'endMon': 10, 'endSec': 0, 'endWeek': 5, 'endWeekday': 0, 'offset': 1, 'startHour': 2, 'startMin': 0, 'startMon': 3, 'startSec': 0, 'startWeek': 2, 'startWeekday': 0}, 'Time': {'day': 1, 'hour': 0, 'hourFmt': 0, 'min': 0, 'mon': 0, 'sec': 0, 'timeFmt': 'DD/MM/YYYY', 'timeZone': 28800, 'year': 0}}, 'range': {'Dst': {'enable': 'boolean', 'endHour': {'max': 23, 'min': 0}, 'endMin': {'max': 59, 'min': 0}, 'endMon': {'max': 12, 'min': 1}, 'endSec': {'max': 59, 'min': 0}, 'endWeek': {'max': 5, 'min': 1}, 'endWeekday': {'max': 6, 'min': 0}, 'offset': {'max': 2, 'min': 1}, 'startHour': {'max': 23, 'min': 0}, 'startMin': {'max': 59, 'min': 0}, 'startMon': {'max': 12, 'min': 1}, 'startSec': {'max': 59, 'min': 0}, 'startWeek': {'max': 5, 'min': 1}, 'startWeekday': {'max': 6, 'min': 0}}, 'Time': {'day': {'max': 31, 'min': 1}, 'hour': {'max': 23, 'min': 0}, 'hourFmt': {'max': 1, 'min': 0}, 'min': {'max': 59, 'min': 0}, 'mon': {'max': 12, 'min': 1}, 'sec': {'max': 59, 'min': 0}, 'timeFmt': ['MM/DD/YYYY', 'YYYY/MM/DD', 'DD/MM/YYYY'], 'timeZone': {'max': 43200, 'min': -46800}, 'year': {'max': 2100, 'min': 1900}}}, 'value': {'Dst': {'enable': 1, 'endHour': 1, 'endMin': 0, 'endMon': 11, 'endSec': 0, 'endWeek': 1, 'endWeekday': 0, 'offset': 1, 'startHour': 3, 'startMin': 0, 'startMon': 3, 'startSec': 0, 'startWeek': 2, 'startWeekday': 0}, 'Time': {'day': 15, 'hour': 15, 'hourFmt': 1, 'min': 48, 'mon': 3, 'sec': 33, 'timeFmt': 'MM/DD/YYYY', 'timeZone': 18000, 'year': 2020}}}, {'cmd': 'GetNorm', 'code': 0, 'initial': {'norm': 'NTSC'}, 'range': {'norm': ['PAL', 'NTSC']}, 'value': {'norm': 'NTSC'}}]
Getting Information: [{'cmd': 'GetDevInfo', 'code': 0, 'value': {'DevInfo': {'B485': 0, 'IOInputNum': 0, 'IOOutputNum': 0, 'audioNum': 1, 'buildDay': 'build 19061408', 'cfgVer': 'v2.0.0.0', 'channelNum': 1, 'detail': 'IPC_51516M5M110000000100000', 'diskNum': 0, 'firmVer': 'v2.0.0.448_19061408', 'hardVer': 'IPC_51516M5M', 'model': 'RLC-420-5MP', 'name': 'Reolink1', 'pakSuffix': 'pak', 'serial': '00000000000000', 'type': 'IPC', 'wifi': 0}}}]
Getting Performance: [{'cmd': 'GetPerformance', 'code': 0, 'value': {'Performance': {'codecRate': 6383, 'cpuUsed': 19, 'netThroughput': 0}}}]
Snap URL: http://192.168.1.122/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=WG849DFJKM&user=admin&password=sT1nkeye
req: <urllib.request.Request object at 0x7eff40748f90>
Could not get Image data
Traceback (most recent call last):
File "test_reolink.py", line 12, in
c.get_snap()
File "/media/home/jay/projects/ReolinkCameraAPI/api/recording.py", line 63, in get_snap
reader = request.urlopen(req, timeout)
File "/media/home/jay/anaconda3/envs/camera-api/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/media/home/jay/anaconda3/envs/camera-api/lib/python3.7/urllib/request.py", line 523, in open
req = meth(req)
File "/media/home/jay/anaconda3/envs/camera-api/lib/python3.7/urllib/request.py", line 1242, in do_request_
raise URLError('no host given')
urllib.error.URLError:
from reolinkapipy.
oops - seems I don't know Github either. I meant to add information, not close
from reolinkapipy.
It's strange that the OpenCV VideoCapture function doesn't return subsequent frames, maybe the method you are using to display the frames retrieved aren't updating?
Don't worry, this repository is still quite experimental and a lot might be broken.
I can't test this right now, could you try checkout branch dev-1.0 and see if you can use the snap API?
Inside the folder where you cloned this repository:
git checkout dev-1.0
from reolinkapipy.
Careful, a password seems to be left in clear in #14 (comment)
from reolinkapipy.
Related Issues (20)
- ImageApi has no example response HOT 3
- Help: List of suppported Camera's HOT 17
- Python installation results in split, arbitrary libraries HOT 6
- Error while decoding MB HOT 3
- Get_snap error HOT 2
- Download files issue HOT 2
- Make image processing dependencies optional HOT 1
- Possibility of reading an alert detection for A series. HOT 5
- Start Recording/Alarm manually - List of Python Commands HOT 2
- Adding support to reolink go camera HOT 2
- Set enable or disable push / email notifications HOT 1
- snap image returns empty despite IP ping working HOT 2
- requirements.txt is empty HOT 3
- login error - is RLC-510a supported? HOT 6
- get_snap incorrectly references random library HOT 3
- Get Alarm Motion not working HOT 1
- Get_snap and Open_video_stream not working HOT 2
- Controlling the camera remotely HOT 1
- I added the ability to update the certificate HOT 1
- Reolink API documentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reolinkapipy.