User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Shooting Panasonic Lumix camera through wifi and Python scripts

Mon Jan 20, 2020 10:34 am

I would like to control a digital camera Panasonic Lumix Lx-15 with my Raspberry pi through wifi, sending commands generated with python scripts. I have been trying to use gphoto2 but this camera do not have USB conectivity. I try to find the way to hack wich commands use the app "Panasonic Image App" that control this camera, I just need simple actions as to shot the camera or start to record and stop it.I would appreciate any help on this topic

yekim54
Posts: 7
Joined: Wed Jul 04, 2018 3:43 pm
Location: Dunn Loring (US)

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Mon Jan 20, 2020 4:17 pm

According to the specs at the link below, the Panasonic Lumix DMC-LX15 has USB 2.0 connectivity.

https://www.dpreview.com/reviews/panaso ... x10-lx15/2
Raspberry Pi 1B, 3B+, 4B

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Mon Jan 20, 2020 5:15 pm

http://www.gphoto.org/proj/libgphoto2/support.php

You may be able to drive it with GPhoto2.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Mon Jan 20, 2020 8:58 pm

In the list appears LX7 that have no wifi connectivity .In LX15 the USBis for charge battery , print and access to files when conected to a PC.Just a data output and not imput...

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Wed Jan 22, 2020 10:39 am

This is what I get when connecting my Raspberry and my camera through USB :
[email protected]:~ $ gphoto2 --auto-detect --list-config
Model Port
----------------------------------------------------------
Panasonic DMC-FS62 usb:001,006

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Device or resource busy). Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-deve[email protected]>, please run
gphoto2 as follows:

env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --auto-detect --list-config

Please make sure there is sufficient quoting around the arguments.
So I presume no way to use gphoto2 on this camera

sagi77
Posts: 2
Joined: Wed Jan 22, 2020 3:52 pm

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Wed Jan 22, 2020 5:44 pm

Try running the command as "sudo gphoto2 --auto-detect --list-config". or "sudo gphoto2 --capture-image" I bet it will work.
I'm trying to get a new post up addressing this problem, I see it when having a ssh connection to my PI, and trying to execute the command.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Thu Jan 23, 2020 10:10 am

I get the same response :
[email protected]:~ $ sudo gphoto2 --capture-image

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Device or resource busy). Make sure no other program (gvfs-gphoto2-volume-monitor) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
ERROR: Could not capture image.
ERROR: Could not capture.
*** Error (-53: 'Could not claim the USB device') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <[email protected]>, please run
gphoto2 as follows:

env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --capture-image

Please make sure there is sufficient quoting around the arguments.
After a lot of googling found something interesting about Panasonic cameras:
" All Lumix G, GX, GH series. (I can test on G80 and GH4)
seems that only GH4, GX80 and GH5 have a usb thethered mode available. Many other Lumix do not offer PTP tethered camera capture/liveview etc. Only option is to use an HTTP protocol over Wifi. (or maybe BLE for newer cams) there are many commands available via this protocol such as shutter speed, iso, aperture, quality, focus, zoom. rec start/stop, capture and capture cancel. also the images are avail....(https://github.com/gphoto/libgphoto2/issues/409)

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sat Jan 25, 2020 4:04 pm

Well ,In the end I managed to shoot the camera through the computer and the browser ( conected to the camera wifi network) with the following command :

Code: Select all

http://192.168.54.1/cam.cgi?mode=camcmd&value=capture
Now I need some help to emulate this html command with python script to do the same with Raspberry Pi . Thanks for any help.

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sat Jan 25, 2020 5:12 pm

You should be able to do that with pycurl. sudo apt install python3-pycurl

Code: Select all

#!/usr/bin/python3

import pycurl
import io

url = "http://192.168.54.1/cam.cgi?mode=camcmd&value=capture"
buffer = io.BytesIO()

curl = pycurl.Curl()
curl.setopt(curl.URL, url)
curl.setopt(curl.WRITEDATA, buffer)
curl.perform()
curl.close()

htmlBody = buffer.getvalue()
print(htmlBody)
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sat Jan 25, 2020 8:06 pm

Thanks for your script , I've tried it but I can't access the camera despite being connected to your network , I get this :

Code: Select all

Traceback (most recent call last):
  File "/home/pi/test-html.py", line 9, in <module>
    curl.perform()
pycurl.error: (7, 'Failed to connect to 192.168.54.1 port 80: No route to host')
Any idea? thanks again-

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sat Jan 25, 2020 8:13 pm

Has it got the same IP address?

Use something like nmap to scan for the camera.
sudo nmap -v -sn 192.168.0.0/16
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sat Jan 25, 2020 8:46 pm

The camera has a static ip : 192.168.54.1 and I can connect to this ip as show in the menu bar icon of wifi but no way to send commands like I do with the PC and browser...

Code: Select all

[email protected]:~ $ sudo iwlist wlan0 scan |egrep  'SSID|Address|Signal'

          Cell 04 - Address: E8:E8:B7:AD:29:04
                    Quality=56/70  Signal level=-54 dBm  
                    ESSID:"LX15-AD2904"
or

Code: Select all

[email protected]:~ $ iwlist wlan0 scan
wlan0     Scan completed :

         Cell 04 - Address: E8:E8:B7:AD:29:04
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=54/70  Signal level=-56 dBm  
                    Encryption key:on
                    ESSID:"LX15-AD2904"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 6950ms ago
                    IE: Unknown: 000B4C5831352D414432393034
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 03010B
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2A0100
                    IE: Unknown: 2D1A200003FF00000000000000000000000100000000000000000000
                    IE: Unknown: 3D160B000200000000000000000000000000000000000000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 7F0100
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
                    IE: Unknown: DD820050F204104A0001101044000102103B000103104700104D454930000010008000E8E8B7AD29041021000950616E61736F6E6963102300054C554D495810240008444D432D4C58313510420001301054000800040050F2040001101100144469676974616C205374696C6C2043616D6572611008000203801049000600372A000120

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sat Jan 25, 2020 8:58 pm

I'd still use nmap to scan 192.168.54.0/24

Then try ping 192.168.54.1

Try using curl http://192.168.54.1/ or wget http://192.168.54.1/ from a command line
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 9:18 am

Hi, it's very strange what's up : I start the wifi in the camera and when:

Code: Select all

[email protected]:~ $ sudo wpa_cli -i wlan0 scan_results
bssid / frequency / signal level / flags / ssid
.......
e8:e8:b7:ad:29:04	2437	-48	[WPA2-PSK-CCMP][WPS][ESS]	LX15-AD2904
It appears the camera SSID : LX15-AD2904 , then I conect and if I put the cursor over the wifi icon of the menu bar appears :
wlan0:Associated with LX-AD2904
wlan0:Configured 192.168.0.44/24
eth0:Link is down

So I presume that the connection is ok but when I try to ping:

Code: Select all

[email protected]:~ $ ping 192.168.54.1
PING 192.168.54.1 (192.168.54.1) 56(84) bytes of data.
From 192.168.0.44 icmp_seq=1 Destination Host Unreachable
From 192.168.0.44 icmp_seq=2 Destination Host Unreachable
From 192.168.0.44 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.54.1 ping statistics ---
13 packets transmitted, 0 received, +11 errors, 100% packet loss, time 290ms
pipe 4
error when :

Code: Select all

[email protected]:~ $ nmap to scan 192.168.54.0/24
Starting Nmap 7.70 ( https://nmap.org ) at 2020-01-26 09:52 CET
Failed to resolve "to".
Failed to resolve "scan".
When I do the connection with WIN10 in my pc I just put the command

Code: Select all

netsh wlan connect name="LX15-AD2904"
and connect instantly

then I put this in the browserPC

Code: Select all

http://192.168.54.1/cam.cgi?mode=camcmd&value=recmode
and when appears in the screen the folowing result, the camera start to act:

Code: Select all

<camrply>
<result>ok</result>
</camrply>

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 9:46 am

On Windows (when it's connected to your camera) run
route print
netsh wlan show interfaces
ipconfig


When your RPi connects to the camera we should be able to get the same stuff with
ip route
iw dev wlan0 info
ip addr show


Comparing the results should show us what's happening with the WiFi AP/DHCP server in your camera.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 10:16 am

This is what I get when using Win10 in my PC

Code: Select all

C:\Users\josep>netsh wlan connect name="LX15-AD2904"
Connection request was completed successfully.

C:\Users\josep>route print
===========================================================================
Interface List
 26...ba 12 4e 0a 7b 4c ......Microsoft Wi-Fi Direct Virtual Adapter #2
  9...9a 12 4e 0a 7b 4c ......Microsoft Wi-Fi Direct Virtual Adapter #4
  6...88 12 4e 0a 7b 4c ......Dell Wireless 1538 802.11 a/g/n Adapter
 21...88 12 4e 8a 7a f6 ......Bluetooth Device (Personal Area Network)
  1...........................Software Loopback Interface 1
 13...90 9b 8d 50 5c 52 ......Generic Mobile Broadband Adapter
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.54.1    192.168.54.10     55
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
     192.168.54.0    255.255.255.0         On-link     192.168.54.10    311
    192.168.54.10  255.255.255.255         On-link     192.168.54.10    311
   192.168.54.255  255.255.255.255         On-link     192.168.54.10    311
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link     192.168.54.10    311
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link     192.168.54.10    311
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    331 ::1/128                  On-link
  6    311 fe80::/64                On-link
  6    311 fe80::4cff:975e:8ad4:1e0e/128
                                    On-link
  1    331 ff00::/8                 On-link
  6    311 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

Code: Select all

C:\Users\josep>netsh wlan show interfaces

There is 1 interface on the system:

    Name                   : Wi-Fi 2
    Description            : Dell Wireless 1538 802.11 a/g/n Adapter
    GUID                   : 171d0c9f-94bb-407b-ba9d-ade67606b8d7
    Physical address       : 88:12:4e:0a:7b:4c
    State                  : connected
    SSID                   : LX15-AD2904
    BSSID                  : e8:e8:b7:ad:29:04
    Network type           : Infrastructure
    Radio type             : 802.11n
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Connection mode        : Profile
    Channel                : 1
    Receive rate (Mbps)    : 72
    Transmit rate (Mbps)   : 72
    Signal                 : 74%
    Profile                : LX15-AD2904

    Hosted network status  : Not available

Code: Select all

C:\Users\josep>ipconfig

Windows IP Configuration


Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Wi-Fi 2:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::4cff:975e:8ad4:1e0e%6
   IPv4 Address. . . . . . . . . . . : 192.168.54.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.54.1

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Mobile Broadband adapter Cellular:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
Now I must wait a little to charge camera battery and test in the Raspberry Pi . Thanks a lot for your help.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 10:33 am

Awaiting to charge battery I would ask you if I need to change something in the file "/etc/dhcpcd.conf" , ussually I have this configuration to work remotely with the raspi device:

Code: Select all

interface eth0
static ip_address=192.168.0.44/24
static routers=192.168.0.
static domain_name_servers=192.168.0.1

interface wlan0
static ip_address=192.168.0.44/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 10:56 am

There's the problem. You need to configure the Raspberry with a static IP in 192.168.54.0/24 or configure it to always use DHCP and configure your 192.168.0.44/24 on the control panel of the router at 192.168.0.1 or 192.168.0.254.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 11:20 am

I gonna try with :

Code: Select all

interface wlan0
static ip_address=192.168.54.44/24
static routers=192.168.54.1
static domain_name_servers=192.168.54.1
because is no router between camera and raspi device it's a direct connection

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 11:34 am

Here comes the test on raspberry :
first detecting camera network :

Code: Select all

[email protected]:~ $ sudo wpa_cli -i wlan0 scan_results
bssid / frequency / signal level / flags / ssid
......
e8:e8:b7:ad:29:04	2462	-43	[WPA2-PSK-CCMP][WPS][ESS]	LX15-AD2904
Raspi conected to camera network:

Code: Select all

[email protected]:~ $ ip route
default via 192.168.54.1 dev wlan0 src 192.168.0.44 metric 303 
192.168.0.0/24 dev wlan0 proto dhcp scope link src 192.168.0.44 metric 303 
192.168.54.1 dev wlan0 scope link src 192.168.0.44 metric 303 

Code: Select all

[email protected]:~ $ iw dev wlan0 info
Interface wlan0
	ifindex 3
	wdev 0x1
	addr dc:a6:32:03:01:6c
	ssid LX15-AD2904
	type managed
	wiphy 0
	channel 11 (2462 MHz), width: 20 MHz, center1: 2462 MHz
	txpower 31.00 dBm

Code: Select all

[email protected]:~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether dc:a6:32:03:01:6b brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:03:01:6c brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.44/24 brd 192.168.0.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::24fc:e1fc:d5e3:ede7/64 scope link 
       valid_lft forever preferred_lft forever

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 11:44 am

Strange that in the "ip route" command appears the eth0 ip numbers of 192.168.0.0/24 and 192.168.0.44 (????) but in the "route print" command in the PC not.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 12:03 pm

Now I comment the eth0 configuration:

Code: Select all

#interface eth0
#static ip_address=192.168.0.44/24
#static routers=192.168.0.
#static domain_name_servers=192.168.0.1
and change pi device ip to : static ip_address=192.168.54.44/24
after run "ip route" I get :

Code: Select all

default via 192.168.54.1 dev wlan0 src 192.168.54.44 metric 303 
192.168.54.0/24 dev wlan0 proto dhcp scope link src 192.168.54.44 metric 303
but when running the script :

Code: Select all

import io
import pycurl
url = "http://192.168.54.1/cam.cgi?mode=camcmd&value=recmode"

buffer = io.BytesIO()

curl = pycurl.Curl()
curl.setopt(curl.URL, url)
curl.setopt(curl.WRITEDATA, buffer)
curl.perform()
curl.close()

htmlBody = buffer.getvalue()
print(htmlBody)
I get this on shell screen :

Code: Select all

Traceback (most recent call last):
  File "/home/pi/test-html.py", line 10, in <module>
    curl.perform()
pycurl.error: (7, 'Failed to connect to 192.168.54.1 port 80: Connection refused')
Now we have advanced something before it was "No route to host'' and now is refused, perhaps this gives us an idea of where the problem may be

User avatar
DougieLawson
Posts: 37570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 1:06 pm

Now take all of that address stuff out and let your RPi get a DHCP assigned address from the camera.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 2:07 pm

New test with all dhcp stuff dissabled...
first a ping to the camera network :

Code: Select all

[email protected]:~ $ ping 192.168.54.1
PING 192.168.54.1 (192.168.54.1) 56(84) bytes of data.
64 bytes from 192.168.54.1: icmp_seq=1 ttl=64 time=1.69 ms
64 bytes from 192.168.54.1: icmp_seq=2 ttl=64 time=1.55 ms
64 bytes from 192.168.54.1: icmp_seq=3 ttl=64 time=1.51 ms
...
^C
--- 192.168.54.1 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 19ms
rtt min/avg/max/mdev = 1.442/15.765/113.199/36.833 ms
after this :

Code: Select all

[email protected]:~ $ ip route
default via 192.168.54.1 dev wlan0 proto dhcp src 192.168.54.10 metric 303 
192.168.54.0/24 dev wlan0 proto dhcp scope link src 192.168.54.10 metric 303 

[email protected]:~ $ iw dev wlan0 info
Interface wlan0
	ifindex 3
	wdev 0x1
	addr dc:a6:32:03:01:6c
	ssid LX15-AD2904
	type managed
	wiphy 0
	channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
	txpower 31.00 dBm
and...

Code: Select all

[email protected]:~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether dc:a6:32:03:01:6b brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:03:01:6c brd ff:ff:ff:ff:ff:ff
    inet 192.168.54.10/24 brd 255.255.255.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::24fc:e1fc:d5e3:ede7/64 scope link 
       valid_lft forever preferred_lft forever
but when running the script :

Code: Select all

Traceback (most recent call last):
  File "/home/pi/test-html.py", line 10, in <module>
    curl.perform()
pycurl.error: (7, '')

User avatar
joseplaselva
Posts: 129
Joined: Tue Oct 04, 2016 4:45 am
Location: Kvilla , Sweden

Re: Shooting Panasonic Lumix camera through wifi and Python scripts

Sun Jan 26, 2020 2:13 pm

Surprise, I tryed again and it works !!!!!!!!!!!!!!!!!!!!!!!!!! I don´t know what I have done... but now it's running.... I must try again to see if I get the same results...

Code: Select all

======================= RESTART: /home/pi/test-html.py =======================
b'<?xml version="1.0" encoding="UTF-8"?>\r\n<camrply><result>ok</result></camrply>'

Return to “Advanced users”