diff --git a/Automate.py b/Automate.py index 8782db2..f44a11f 100644 --- a/Automate.py +++ b/Automate.py @@ -63,7 +63,7 @@ class Server: self.dic["maintenance"] = camera_status["maintenance"] self.dic["timelapse"] = camera_status["interval"] self.dic["conf nb_images"] = camera_status["nb_images"] - self.dic["set_config"] = camera_status["idle"] + self.dic["set_config"] = not camera_status["idle"] self.dic["stop current config"] = camera_status["stop_flag"] else: print("mauvais code") diff --git a/CONFIG/config.json b/CONFIG/config.json index 573080f..9660ea9 100644 --- a/CONFIG/config.json +++ b/CONFIG/config.json @@ -1 +1 @@ -{"set_config": false, "maintenance": false, "stop current config": false, "timelapse": 3, "conf nb_images": 1, "nb_images restantes": 1} \ No newline at end of file +{"set_config": true, "maintenance": false, "stop current config": false, "timelapse": 3, "conf nb_images": 10, "nb_images restantes": 1} \ No newline at end of file diff --git a/PROJECT/2025-04-27 17:59:28/2025-04-27 17:59:28.jpg b/PROJECT/2025-04-27 17:59:28/2025-04-27 17:59:28.jpg new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/2025-04-27 17:59:28/2025-04-27 17:59:28.json b/PROJECT/2025-04-27 17:59:28/2025-04-27 17:59:28.json new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/2025-04-27 18:00:56/2025-04-27 18:00:56.jpg b/PROJECT/2025-04-27 18:00:56/2025-04-27 18:00:56.jpg new file mode 100644 index 0000000..33e2c0d Binary files /dev/null and b/PROJECT/2025-04-27 18:00:56/2025-04-27 18:00:56.jpg differ diff --git a/PROJECT/2025-04-27 18:00:56/2025-04-27 18:00:56.json b/PROJECT/2025-04-27 18:00:56/2025-04-27 18:00:56.json new file mode 100644 index 0000000..e70fba4 --- /dev/null +++ b/PROJECT/2025-04-27 18:00:56/2025-04-27 18:00:56.json @@ -0,0 +1 @@ +{"timestamp": "2025-04-27 18:00:56", "temperature": 38.14068818188754, "humidity": 22.47333485923552} \ No newline at end of file diff --git a/Send_data_stocked.py b/Send_data_stocked.py index 6ce0efa..433caec 100644 --- a/Send_data_stocked.py +++ b/Send_data_stocked.py @@ -54,10 +54,10 @@ class Send_data_stocked: 'image': (image_path, open(image_path, 'rb'), 'image/jpeg') } try: - #print(data) + print("Datas are : ",data) #print(files) response = requests.post(self.url, headers=self.headers, data=data, files=files) - print(response) + print("Answer from server is : ",response) response.raise_for_status() response_data = response.json() return response_data diff --git a/script.sh b/script.sh index ca0669a..6d6b000 100755 --- a/script.sh +++ b/script.sh @@ -12,4 +12,4 @@ else echo "pas connecté à internet" python Time_Lapse_NoConnection.py fi -python Automate.py \ No newline at end of file +python Automate.py diff --git a/timelapse-service.log b/timelapse-service.log new file mode 100644 index 0000000..42b2f5c --- /dev/null +++ b/timelapse-service.log @@ -0,0 +1,23 @@ +Erreur : Insufficient privileges. +Connecté à internet +[0:13:07.775780345] [3774]  INFO Camera camera_manager.cpp:327 libcamera v0.4.0+53-29156679 +[0:13:07.806936514] [3777]  WARN RPiSdn sdn.cpp:40 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise +[0:13:07.809437125] [3777]  INFO RPI vc4.cpp:447 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media1 and ISP device /dev/media3 +[0:13:07.809535588] [3777]  INFO RPI pipeline_base.cpp:1121 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml' +[0:13:07.816878221] [3774]  INFO Camera camera.cpp:1202 configuring streams: (0) 800x600-XBGR8888 (1) 1296x972-SGBRG10_CSI2P +[0:13:07.817365292] [3777]  INFO RPI vc4.cpp:622 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA +qt.qpa.xcb: could not connect to display +qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. +This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. + +Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb. + +/home/timelapse/Documents/Time_Lapse/script.sh : ligne 14 : 3774 Abandon python Time_Lapse_Connection.py +Noms des dossiers : [] +Here is the answer from the server : {'id': 1, 'interval': 5, 'nb_images': 10, 'maintenance': False, 'stop_flag': True, 'idle': False} +Here are the datas loaded : {'set_config': True, 'maintenance': False, 'stop current config': True, 'timelapse': 5, 'conf nb_images': 10, 'nb_images restantes': 1} +- No Maintenance +- Stopping current config +- New Config +- Shut Down +TimeLapse sent is : 5