Feature #743

Add PiSentry system: a webcam meta build

Added by Hammel about 1 year ago. Updated 11 days ago.

Status:ClosedStart date:29 Feb 2020
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Systems
Target version:2.0 - Harkonnen
Severity:01 - Critical

Description

This is just a modified version of the PiBox Media System that contains only the following packages.

  • appmgr
  • launcher
  • mjpg-streamer
  • monkey
  • omxplayer
  • piboxd
  • piboxmediaserverui
  • piboxwww
  • picam
  • psplash
  • videofe

The UI should just have the network and picam app displayed. This allows a console view of the camera. It also allows network configuration from the console. However, the main purpose is to provide a web based interface only. So this also needs to have an AP mode that allows configuring the network for the system. This would require a variation of Ironman's imwww interface. This can be in a different subdirectory and launched separately depending on the mode the device is in, which can be handled with GPIO pins.

This build should also provide Ironman functionality by allowing the Pi to register as a sensor device.

As a bonus: add an option to make PiSentry a USB UVC gadget, allowing it to stream data to a USB host. This would allow a set of PiSentry's to be managed by a single host, albeit only if they are hardwired.


Related issues

Related to PiBox - Feature #744: add webcam motion detection New 01 Mar 2020
Blocked by pinet - Feature #815: Add headless mode Closed 20 Feb 2021
Blocked by piboxwww - Feature #816: Add build option for PiSentry Closed 20 Feb 2021

Associated revisions

Revision 915b3df5
Added by Hammel 18 days ago

RM #743: Add HW=pisentry support that disables network configuration option.

Revision 4877c5ff
Added by Hammel 17 days ago

RM #743: Add init script for headless mode. Remove unused cli options.

Revision 4877c5ff
Added by Hammel 17 days ago

RM #743: Add init script for headless mode. Remove unused cli options.

Revision e15ee0f0
Added by Hammel 14 days ago

RM #743: Add pisentry mode.

History

#1 Updated by Hammel about 1 year ago

  • Description updated (diff)

#2 Updated by Hammel 10 months ago

  • Subject changed from Add webcam meta build to Add PiSentry system: a webcam meta build

#3 Updated by Hammel 9 months ago

Possible recommended cameras:

Microsoft Lifecam HD-3000
Microsoft Lifecam HD-5000
Microsoft Lifecam Cinema 720p HD webcam
Microsoft LifeCam Studio 1080p HD
Logitech Webcam C250 1.3 megapixel webcam
Logitech QuickCam® Sphere AF. Motorised 2-megapixel HD sensor webcam with Carl Zeiss® optics.
Logitech Webcam C270
PAPALOOK PA150 / PA150S

#4 Updated by Hammel 9 months ago

  • Priority changed from High to Immediate
  • Severity changed from 01 - Critical to 03 - Medium

#5 Updated by Hammel 7 months ago

  • Description updated (diff)

#6 Updated by Hammel 6 months ago

  • Severity changed from 03 - Medium to 02 - High

#7 Updated by Hammel 5 months ago

  • Severity changed from 02 - High to 03 - Medium

#8 Updated by Hammel about 1 month ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
Now that I have piplayer and pinet I think a better solution for doing this without a display is:
  1. Add a headless (daemon) mode to pinet
  2. If pinet gets a SIGUSR1 then it toggles state.
    1. Initial state is non-AP mode.
    2. AP state starts imwww and blinks an LED slowly.
    3. SIGUSR1 toggles back to non-AP mode and blinks an LED fast 5 times when the network has restarted.

The camera works independent of Ironman (for now, I'll add registration stuff later). It's a stand alone solution.
I need a momentary push button that ties the GPIO pin to vcc and an led on a different GPIO pin.
Pinet can either read the GPIO pin in a thread using libgpiod (which would need to be an added package or Buildroot package) or use Ironman's gpio utility. The latter would require popen/system and probably isn't the best option, though that utility could be updated to generate a library that pinet could use.

This changes the metabuild to the following apps:

  • mjpg-streamer
  • monkey
  • piboxd
  • piboxwww
  • pinet
  • imwww

pinet gets launched in headless mode at boot time via an init script. It watches the GPIO pin for state changes and acts accordingly.
monkey and piboxwww should always be running and allow only user management and webcam viewing.

This also needs to disable X.org so it doesn't try to boot up. Firstboot should recognize there is no display connected.

#9 Updated by Hammel about 1 month ago

  • Severity changed from 03 - Medium to 01 - Critical

#10 Updated by Hammel 19 days ago

This requires a new app - pisentrycfg. This will disable some features of the development platform like X.org and SMB that are not required for the camera.

#11 Updated by Hammel 18 days ago

  • % Done changed from 10 to 40

pisentrycfg created and added to metabuild.
piboxwww updated to support HW=pisentry to remove network config option.

#12 Updated by Hammel 14 days ago

This is basically working on the touchscreen hw. Now I need to try it on the true headless hw.

The biggest problem is that the network restart is not working well. I might want to switch from network restart to node reboot from the restart script. This might help prevent getting stuck in AP mode on failures.

#13 Updated by Hammel 14 days ago

  • % Done changed from 40 to 70

Much of this is working now but there are problems with wifi. The USB dongle is mostly stable but has problems that can leave things in a bad state. So there is work (RM #826) that will handle recovering on reboot.

The brcm drivers are also having problems, likely due to a firmware bug. This may require a kernel update. See RM #817.

Once I have the recovery bit in place I can close this issue after a full rebuild and test. Other issue will be tracked separately.

#14 Updated by Hammel 11 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 70 to 100

The metabuild works and the system installs cleanly.

All changes committed and pushed.

Closing issue.

Also available in: Atom PDF