2

I just installed motion but I can't get it to work. Im acessing my pi via local IP. SSH, VNC and apache works, but motion simply doesn't. I've already changed the ports at /etc/motion/motion.conf to lots of different numbers but none of them work. I've found this command: sudo motion -n When I run this, I get this message: "Problem enabling stream server in port 7043: Address already in use"

I get this for every port I try. Always when I configure a new port and run netstat -lnutp this port appears in the list and its marked as 'LISTEN'. I try to access but nothing happens. Does my camera need to work to motion at least appears when I try 192.168.1.x:7043? Can't I at least see the server running, even if the camera doesn't work? I'm using a microsoft USB camera, which appears to work with the rPi.

Here's the full list of errors:

[0] Motion thread 1 restart
[1] Thread 1 started
[1] cap.driver: "sonixj"
[1] cap.card: "USB camera"
[1] cap.bus_info: "usb-bcm2708_usb-1.3"
[1] cap.capabilities=0x85200001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: JPEG (JPEG)
[1] Selected palette JPEG
[1] Test palette JPEG (320x240)
[1] Error setting pixel format VIDIOC_S_FMT: Device or resource busy
[1] VIDIOC_TRY_FMT failed for format JPEG: Device or resource busy
[1] Unable to find a compatible palette format.
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] bind(): Address already in use
[1] Problem enabling stream server in port 7043: Address already in use
[1] Thread exiting

UPDATE:

Motion.conf file

http://pastebin.com/XF2aEJhD

  • it looks like you have a port conflict use this command netstat -tulpn to find out what is listening on that port, and either close it or choose a different port for motion. You may also want to make sure you restart motion after changing the port. – Steve Robillard Apr 2 '15 at 5:16
  • @SteveRobillard I already tried lots of different ports, like 7043, which was not in use at netstat -tulpn. I've restarted too. – Gergraf Apr 2 '15 at 5:25
  • It's not clear whether your camera is working or not. Perhaps motion will not create a web-page for a non-functioning camera. – joan Apr 2 '15 at 7:52
  • @joan yeah, I think he would create too. I've tested a program that captures my webcam and it works. Also, now when motion is on, the webcam led ligths, so its working. The problem is that every port I choose, appears as 'already in use'. – Gergraf Apr 2 '15 at 14:28
  • Can you post the output of running ps -ef | grep motion ? To see if you have a other motion process already running. – jotadepicas Apr 2 '15 at 17:06
4

You are wasting your time trying to get Motion to work reliably on the PI. Others have tried and it will disconnect from your cam after an hour or 2. This happened to me as well. Requests to the author of Motion to fix the bugs resulted in nothing

  • 1
    Ive been running motion for over 2 years now on ubuntu. When the new model 900mhz quad came out I figured Id try motion on one and it works great with arch arm. – user35569 Oct 9 '15 at 11:54
  • It does seem to be something we get a lot of complaints about here. Of course exceptions aren't the rule, but because people seldom post "So, all the software is working fine today," it's hard to tell what "the rule" actually amounts to -- I haven't used motion myself. I do think the camera is more reliable at half resolution. – goldilocks Oct 9 '15 at 13:56
1

Using motion V4.0 this helpful parameters are:

# change the following options in your motion.conf from on to off

stream_localhost off
stream_port 8081

webcontrol_localhost off
webcontrol_port 8080
0

This will not solve all your errors but will ensure that your options are set according to your expectation that the Motion server is not only reachable through http://localhost:8080

# change the following options in your motion.conf from on to off

webcam_localhost off
webcam_port 8081

control_localhost off
control_port 8080

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.