Giter Site home page Giter Site logo

imagenode's People

Contributors

jeffbass avatar sbkirby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imagenode's Issues

AttributeError: module 'signal' has no attribute 'SIGALRM' - receive_test.py

This following error occurs with Windows 10 while running receive_test.py:

python imagenode\tests\receive_test.py

FPS Test Program:  imagenode\tests\receive_test.py
Option settings:
    Receive Image Type: jpg
    Show Images: True
    Test Duration: 30  seconds
First Image Received. Starting FPS timer.
Python error with no Exception handler:
Traceback error: module 'signal' has no attribute 'SIGALRM'
Traceback (most recent call last):
  File "imagenode\tests\receive_test.py", line 113, in <module>
    receive_images_forever()
  File "imagenode\tests\receive_test.py", line 96, in receive_images_forever
    signal.signal(signal.SIGALRM, timer_done)
AttributeError: module 'signal' has no attribute 'SIGALRM'

Total Number of Images received: 0
Never got any images from imagenode. Ending program.

A work-around (not a fix) for this error can be made to receive_test.py. Add the following line of code to the import section of receive_test.py.

from sys import platform

Next, replace the following lines in function receive_images_forever() with the following:

            signal.signal(signal.SIGALRM, timer_done)
            signal.alarm(TEST_DURATION)

replace with

            if platform != "win32":
                  signal.signal(signal.SIGALRM, timer_done)
                  signal.alarm(TEST_DURATION)
            else:
                  pass

Note: This will stop the error from occurring, but the FPS test will not time out. This will allow you to run the script and tune the motion detection of your YAML file.

Implementation

how you implemented the imagenode in raspberrypi and what changes we need to do?I am testing this project using single raspberrypi as imagenode and my pc(linux os) as image hub.what changes do i need to do for running this project successfully using my resources?

REP checking fails when sending images in thread

The design of imagenode uses the ZMQ REQ / REP messaging pattern. However, the REQ / REP messaging pattern needs each imagenode to be restarted if the imagehub is restarted. Also, if there is a glitch in the network or the power, the REQ / REP message pattern can get stalled and the imagenode needs to be restarted. Testing for “REQ sent, but no timely REP received” is important for imagenode reliability.

In the existing version of imagenode (as of 12/17/2020), a signal.SIGALRM timer is set every time a REQ is sent from the imagenode to the imagehub. If the REP is not received from the imagehub within settings.patience seconds, an exception is raised and the fix_comm_link() method is called. Because signal.SIGALRM does not work in Python threads, REP checking fails when sending images in a separate thread using the send_threading yaml option. Sending images in a thread makes the imagenode frame rate significantly faster, so fixing this is important.

I am testing an alternative that makes the following changes.:

  1. Remove the try / except with Patience(settings.patience) block from the imagenode main program. This try / except block uses signal.SIGALRM timer that does not work with Python threads.
  2. Replace it with a simple call to the send_frame() method without a try / except block.
  3. Add a REP_watcher yaml option. If it is True, then a timed version of the send_frame() method is used. In the timed version of the send_frame() method, a timestamp is recorded when the REQ is sent and a second timestamp is recorded when the REP is received. A separate REP_watcher thread checks the timestamps every settings.patience seconds. If there is no timely REP after a REQ, then the fix_comm_link() method is called. This new algorithm behaves like the old one did in the main program, but also works in the threaded send_frame() method.

This new REP_watcher code is being tested now. After testing, I will move it to the master branch. It should not break any existing imagenode uses, but please raise an issue if you notice any anomalies. The new REP_watcher option will default to True, which results in the same imagenode behavior as the existing signal.SIGALRM algorithm did.

Multiple motion ROI's with one RPi camera

Hey Jeff, I hope all is well with you. You mentioned ...it is helpful to specify multiple motion detectors with different ROI's and different thresholds to cover different parts of the imaging area in your settings-yaml.rst doc file. Do you have an example? I've tried a couple of things, but can't seem to get it to work.

Thanks
Stephen

High resolution image capture problem

Hey @jeffbass,
I've been experimenting with high resolution image capture, and noticed a problem that is prevalent during this mode. It appears as though imagenode is writing over the images, and sending the same image two or three times in a row. I added some code to print a timestamp on each image for troubleshooting, and expected to get an image with the same timestamp on each of the duplicate images. Well, I'm getting the same timestamp(s), but it appears as though several timestamps are superimposed on top of one another. Not what I expected. This same code works as expected on RPi Zero's with a resolution of (640,480) @ 30 fps. I've attached a couple of example of images.
I'm using a YAML like the bird_cam_rpi.yaml with a RPi 4B, 2GB memory and RPi HQ 12M pixel camera.

Thanks
Stephen

SkyView-RPiCam1-2020-08-15T15 59 15 206092

SkyView-RPiCam1-2020-08-15T12 24 50 354733

Test1 does not use correct path to YAML for me

Jeff, I am following your instructions (hopefully to the letter). I did the git install and checked all dependancies. I am running in the venv py3cv3 (from pyimagesearch). When I try running imagenode with test1, I get an error that it cannot find the imagenode.yaml file. I tried just loading python, import OS, and print(os.path.expanduser("~")) it returns /home/pi and obviously does not find the yaml file there. I figured I could just tweak to fix it, but this usually solves one problem and causes several more.

This happens both in VSCode as well as from the terminal. receivetest.py is running in the background in the same environment with no errors.

2021-11-16 20:22:08,886 ~ Unanticipated error with no Exception handler. Traceback (most recent call last): File "imagenode.py", line 29, in main settings = Settings() # get settings for node cameras, ROIs, GPIO File "/home/pi/imagenode/imagenode/tools/imaging.py", line 1337, in __init__ with open(os.path.join(userdir, "imagenode.yaml")) as f: FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/imagenode.yaml' 2021-11-16 20:22:08,890 ~ Exiting imagenode.py

Temperature Sensor DHT11/DHT22 code

Hey Jeff,
You mentioned in the docs/settings-yaml.rst documentation that "There is ongoing testing with DHT22 temperature and humidity combined sensors". I have a current need for a Temp/Humidity sensor, and I would be more than happy to Test the code. So happens, the only Temperature Sensor I current have is a DHT22.

Thanks,
Stephen

Multiple overlaid timestamps on an image being sent by detect_motion

Hi Stephen (@sbkirby ),
Thanks again for your debugging efforts on images captured by detect_motion. I used your "draw_time" yaml settings on one of my RPi cams that is sending at 640x480 resolution with a framerate setting of 16. It sent an image with two timestamps on the same image (and it also sent images with a single timestamp). I now have a reproducible example that shows it is not your use of the high resolution camera that is the problem. I'll try to debug this relatively soon and keep you posted. If you come up with anything, let me know.
Here's the image from my Driveway-Mailbox RPi with 2 timestamps on the same image.
Jeff

Driveway-Mailbox-2020-08-16T19 11 42 337177

nodehealth.py - get_ipaddress in 0.3.0

Hey Jeff,
I've loaded 0.3.0, and I have a question about valid_prefix in the function get_ipaddress of nodehealth.py. According the commented portion of line 115 we are supposed to edit that line to our IP address...Is that correct?

Do I need to do anything else for version 0.3.0?

Stephen B Kirby

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.