View: 2603|Reply: 5

server.py out of memory while activating camera

[Copy link]

6

Threads

15

Posts

174

Credits

Registered member

Rank: 2

Credits
174
Post time 2019-6-8 02:47:51 | Show all posts |Read mode
Hi all,
after installation of my RasperryPi Mars RobotCar the server will not start. When starting server.py the following messages appear, which indicate a memory shortage problem. However when checking memory allocation there does not appear to be a shortage (see following reports). Also I have checked that the camera is enabled in configuration!

Any suggestions?

pi@raspberrypi:~/Adeept_PiCar-B/server $ python3 server.py
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 456, in _init_camera
    self._camera = mo.MMALCamera()
  File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 2279, in __init__
    super(MMALCamera, self).__init__()
  File "/usr/lib/python3/dist-packages/picamera/mmalobj.py", line 633, in __init__
    prefix="Failed to create MMAL component %s" % self.component_type)
  File "/usr/lib/python3/dist-packages/picamera/exc.py", line 184, in mmal_check
    raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "server.py", line 692, in <module>
    camera = picamera.PiCamera()              #Camera initialization
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 431, in __init__
    self._init_camera(camera_num, stereo_mode, stereo_decimate)
  File "/usr/lib/python3/dist-packages/picamera/camera.py", line 460, in _init_camera
    "Camera is not enabled. Try running 'sudo raspi-config' "
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
pi@raspberrypi:~/Adeept_PiCar-B/server $ cat /proc/meminfo
MemTotal:         895524 kB
MemFree:          529472 kB
MemAvailable:     722876 kB
Buffers:           27384 kB
Cached:           217264 kB
SwapCached:            0 kB
Active:           184720 kB
Inactive:         138792 kB
Active(anon):      79212 kB
Inactive(anon):    11892 kB
Active(file):     105508 kB
Inactive(file):   126900 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:        102396 kB
SwapFree:         102396 kB
Dirty:                28 kB
Writeback:             0 kB
AnonPages:         78860 kB
Mapped:            69724 kB
Shmem:             12244 kB
Slab:              24404 kB
SReclaimable:      11904 kB
SUnreclaim:        12500 kB
KernelStack:        1616 kB
PageTables:         2928 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      550156 kB
Committed_AS:     779408 kB
VmallocTotal:    1163264 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:              416 kB
CmaTotal:           8192 kB
CmaFree:            6156 kB

Thank you very much for any help.




Reply

Use magic Report

0

Threads

69

Posts

412

Credits

Website Editor

Rank: 8Rank: 8

Credits
412
Post time 2019-6-10 12:00:05 | Show all posts
  • That out of memory doesn’t imply a shortage in memory. It suggests that the camera recourse have been occupied and cannot be applied repeatedly. The cause may be that server.py has already run in background. You can shut down the program which occupy the camera with sudo killall python3
  • In the first installation, do not use name in upper case, or it will not automatically start up at boot. Rename the folder Adeept_PiCar-B as adeept_picar-b or run the autostart.py

autostart.py

713 Bytes, Downloads: 131

Reply

Use magic Report

6

Threads

15

Posts

174

Credits

Registered member

Rank: 2

Credits
174
 Author| Post time 2019-6-12 00:00:48 | Show all posts
Edited by 1557476497 at 2019-6-12 12:15 AM

Hello,
thank you for your fast response. I did as recommended, but without success. server.py did not start - with same error.
I the changed chmod for car.desktop in autostart to execute and tried to manually start car.desktop with the following error result:

pi@raspberrypi:~/.config/autostart $ ./car.desktop
Traceback (most recent call last):
  File "//home/pi/adeept_picar-b/server/server.py", line 11, in <module>
    import ultra
  File "/home/pi/adeept_picar-b/server/ultra.py", line 11, in <module>
    import turn,led
  File "/home/pi/adeept_picar-b/server/turn.py", line 35, in <module>
    vtr_mid_orig    = num_import_int('E_C1:')
  File "/home/pi/adeept_picar-b/server/turn.py", line 25, in num_import_int
    with open("set.txt") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'set.txt'
./car.desktop: Zeile 8: Development: Kommando nicht gefunden.

To proof that module 'set.txt' is in directory i then went to directory and displayed modules as follows:

pi@raspberrypi:~/.config/autostart $ cd /home/pi/adeept_picar-b/server/
pi@raspberrypi:~/adeept_picar-b/server $ ls
findline.py  motor.py   __pycache__  serverTest.py  setup.py   turn.py   ultra.py
led.py       motor.pyc  server.py    set.txt        speech.py  turn.pyc  ultra.pyc

Mysterious is also the error : car.desktop Line 8: Development: Command not found   - (german output translated to english by me!)

Any considerations? Thanks for your response.

Btw: I am running a preinstalled raspian with NOOBS !
Reply

Use magic Report

0

Threads

69

Posts

412

Credits

Website Editor

Rank: 8Rank: 8

Credits
412
Post time 2019-6-12 15:02:02 | Show all posts
1557476497 replied at 2019-6-12 12:00 AM
Hello,
thank you for your fast response. I did as recommended, but without success. server.py did no ...

Raspbian installed with NOOBS can have lots of optional versions. We have tested and Lite doesn't  work.
sudo cp -f //home/pi/adeept_picar-b/server/set.txt //home/pi/set.txt can solve the problem that set.txt cannot be found.

Reply

Use magic Report

6

Threads

15

Posts

174

Credits

Registered member

Rank: 2

Credits
174
 Author| Post time 2019-6-16 22:13:34 | Show all posts
Hello,
now I have installed the standard raspian SW. Camera is enabled but does still not work.
After testing with the standard rasping camera test: "raspistill -o image.jpg" the following error appears:

pi@raspberrypi:~/adeept_picar-b/server $ raspistill -o image.jpg
mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly

I tested all the connection to the camera but did not find any error. Any suggestions?
Thank for your help.
Reply

Use magic Report

6

Threads

15

Posts

174

Credits

Registered member

Rank: 2

Credits
174
 Author| Post time 2019-6-17 00:10:58 | Show all posts
Mea Culpa !
It was my and only my fault!
I had the camera connector inserted into the Rasperry Pi Terminal connecter instead of the camera connector! Mars Rover is now working - at least it is functional, and I can proceed!
Sorry for any inconvenience .
Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules