Multiple counters with one script

More
9 years 4 months ago - 9 years 4 months ago #8 by ThibmoRozier
Not really, python is one and the same thing, really.
But I tried it again, and here is some more proof.
It works here. :/
http://pastebin.com/r7LwsB0b
Or check attatchment for *.py file.

File Attachment:

File Name: MultiPyRadmon.zip
File Size:6 KB



Console output with demo:
>>> 
Reading configuration:

	
	User name configured

	
	Password configured

	
	Serial port name configured

	
	Serial port speed configured

	
	Protocol configured

	

Using Demo mode for 1 => geiger 1


Reading configuration:

	
	User name configured

	
	Password configured

	
	Serial port name configured

	
	Serial port speed configured

	
	Protocol configured

	

Using Demo mode => geiger 2


Gathering data started => geiger 1


Gathering data started => geiger 2

No samples in queue, waiting 5 seconds => geiger 1



Geiger sample => geiger 1:	[34, datetime.datetime(2014, 10, 19, 12, 8, 33, 256000)] 


Geiger sample => geiger 2:	No samples in queue, waiting 5 seconds => geiger 2

[35, datetime.datetime(2014, 10, 19, 12, 8, 36, 248000)]
 


Geiger sample => geiger 1:	[38, datetime.datetime(2014, 10, 19, 12, 8, 38, 260000)] 


Average result => geiger 1:	CPM = 36 	2014-10-19 12:08:38.260000 


Geiger sample => geiger 2:	Connecting to server => geiger 1

[35, datetime.datetime(2014, 10, 19, 12, 8, 41, 260000)]
 


Sending average sample => geiger 1: 36 CPM


Server response => geiger 1:  HTTP/1.1 200 OK 


Waiting 30 seconds => geiger 1


Geiger sample => geiger 1:	[10, datetime.datetime(2014, 10, 19, 12, 8, 43, 264000)] 


Geiger sample => geiger 2:	[38, datetime.datetime(2014, 10, 19, 12, 8, 46, 284000)] 


Geiger sample => geiger 1:	[26, datetime.datetime(2014, 10, 19, 12, 8, 48, 264000)] 


Geiger sample => geiger 2:	[17, datetime.datetime(2014, 10, 19, 12, 8, 51, 346000)] 


Geiger sample => geiger 1:	[34, datetime.datetime(2014, 10, 19, 12, 8, 53, 326000)] 


Geiger sample => geiger 2:	[8, datetime.datetime(2014, 10, 19, 12, 8, 56, 412000)] 


Geiger sample => geiger 1:	[33, datetime.datetime(2014, 10, 19, 12, 8, 58, 392000)] 


Geiger sample => geiger 2:	[34, datetime.datetime(2014, 10, 19, 12, 9, 1, 472000)] 


Geiger sample => geiger 1:	[22, datetime.datetime(2014, 10, 19, 12, 9, 3, 452000)] 


Geiger sample => geiger 2:	[26, datetime.datetime(2014, 10, 19, 12, 9, 6, 539000)] 


Geiger sample => geiger 1:	[24, datetime.datetime(2014, 10, 19, 12, 9, 8, 459000)] 


Average result => geiger 2:	CPM = 35 	2014-10-19 12:08:36.248000 


Connecting to server => geiger 2


Geiger sample => geiger 2:	[37, datetime.datetime(2014, 10, 19, 12, 9, 11, 539000)] 


Sending average sample => geiger 2: 35 CPM


Server response => geiger 2:  HTTP/1.1 200 OK 


Waiting 30 seconds => geiger 2


Geiger sample => geiger 1:	[39, datetime.datetime(2014, 10, 19, 12, 9, 13, 523000)] 


Geiger sample => geiger 2:	[35, datetime.datetime(2014, 10, 19, 12, 9, 16, 543000)] 


Geiger sample => geiger 1:	[40, datetime.datetime(2014, 10, 19, 12, 9, 18, 553000)] 


Geiger sample => geiger 2:	[17, datetime.datetime(2014, 10, 19, 12, 9, 21, 545000)] 


Geiger sample => geiger 1:	[8, datetime.datetime(2014, 10, 19, 12, 9, 23, 555000)] 


Geiger sample => geiger 2:	[20, datetime.datetime(2014, 10, 19, 12, 9, 26, 552000)] 


Geiger sample => geiger 1:	[8, datetime.datetime(2014, 10, 19, 12, 9, 28, 562000)] 


Geiger sample => geiger 2:	[38, datetime.datetime(2014, 10, 19, 12, 9, 31, 552000)] 


Geiger sample => geiger 1:	[39, datetime.datetime(2014, 10, 19, 12, 9, 33, 562000)] 


Geiger sample => geiger 2:	[26, datetime.datetime(2014, 10, 19, 12, 9, 36, 552000)] 


Geiger sample => geiger 1:	[40, datetime.datetime(2014, 10, 19, 12, 9, 38, 562000)] 


Geiger sample => geiger 2:	[9, datetime.datetime(2014, 10, 19, 12, 9, 41, 590000)] 


Average result => geiger 1:	CPM = 27 	2014-10-19 12:09:38.562000 


Connecting to server => geiger 1


Sending average sample => geiger 1: 27 CPM


Server response => geiger 1:  HTTP/1.1 200 OK 


Waiting 30 seconds => geiger 1


Geiger sample => geiger 1:	[19, datetime.datetime(2014, 10, 19, 12, 9, 44, 350000)] 


Geiger sample => geiger 2:	[31, datetime.datetime(2014, 10, 19, 12, 9, 47, 434000)] 


Geiger sample => geiger 1:	[10, datetime.datetime(2014, 10, 19, 12, 9, 49, 354000)] 


Geiger sample => geiger 2:	[5, datetime.datetime(2014, 10, 19, 12, 9, 52, 435000)] 


Geiger sample => geiger 1:	[40, datetime.datetime(2014, 10, 19, 12, 9, 54, 415000)] 


Geiger sample => geiger 2:	[5, datetime.datetime(2014, 10, 19, 12, 9, 57, 502000)] 


>>> Geiger sample => geiger 1:	[14, datetime.datetime(2014, 10, 19, 12, 9, 59, 484000)] 


Geiger sample => geiger 2:	[30, datetime.datetime(2014, 10, 19, 12, 10, 2, 564000)] 




CTRL+C pressed, exiting program

	 


Gathering data from Geiger stopped => geiger 1


Gathering data from Geiger stopped => geiger 2



>>>
Attachments:
Last edit: 9 years 4 months ago by ThibmoRozier.

Please Log in or Create an account to join the conversation.

More
9 years 4 months ago #79 by ThibmoRozier
Oke, seems like it works now. :D
Geesh. ^_^
Now time to relax a bit and wait until the other script part comes in. :P
Hope there won't be any complications included with the script, if so, please provide the error message and a brief description

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #510 by Juzzie
I cant get it to work. Below is the error message :

" Traceback (most recent call last):
File "multiPyRadmon.py", line 10, in <module>
import pyaudio
ImportError: No module named pyaudio "

Owner and operator of "southofhobart" monitoring stations.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #511 by mw0uzo
Have you installed pyAudio, the python audio library?

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #512 by ThibmoRozier
No wait, Dan. I'll upload one without audio for Juzzie. ^_^
The following user(s) said Thank You: Juzzie

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #513 by Juzzie
nice. Im trying it out now....

Owner and operator of "southofhobart" monitoring stations.

Please Log in or Create an account to join the conversation.

Moderators: Gamma-Man
Time to create page: 0.179 seconds
Powered by Kunena Forum
Everything's free. Please support us by considering a donation. Log in first!
Solar powered Raspberry Pi 4 server stats: CPU 33% Memory 14% Swap 0% CPU temp=55.5'C Uptime 14:10, Days