Communicating between sense hats - Raspberry Pi Forums


i have project send , display data between 2 sense hats. mobile project communication wifi or bluetooth.
both pi running wordpress web site , want pi 1 send $_get pi 2 call python script execute on pi 2 , display message $_get.
current attempt send python script on pi2 not executed.
code proof of concept @ point, wondering if sensible way go, or if possible make work.
advice appreciated.

pi 1 send $_get in form local ip append message
eg 192.168.0.105/message-center/?message=test+sense

code on pi 2

code: select all

<?php /*   * template name:message  *   *   */ ?> <?php get_header(); ?>  		<div id="container"> 			<div id="content" role="main">                 <?php 			/* run loop output page. 			 * if want overload in child theme include file 			 * called loop-page.php , used instead. 			 */ 			get_template_part( 'loop', 'page' ); 			 			//get  message 			//print_r($_get); 			//echo "<br />";  			//$message= $_get['message']; appened $command 			$command= "/home/pi/sense-test.py"; 			exec($command); 			 			echo $message; 			echo "<br />"; 			echo "message recieved"; 			echo "the time is" . date9"h:i:sa"); ?>                         </div>                 </div>                                                     <?php get_footer(); ?> 
pi 2 sense hat sense-test.py

code: select all

#!/usr/bin/env python3  sense_hat import sensehat  sense = sensehat()  sense.show_message("hello world")

have tried using system() rather exec()? py code has executable permissions?

prefer udp on tcp if devices on same localnet. opinion.


raspberrypi



Comments

Popular posts from this blog

Valutazione Template - Joomla! Forum - community, help and support

SD Datastring Convention

First use of Arduino Uno : avrdude error on Blink uploading