Skywalker roaster... | [403] |
Skywalker, the AL... | [314] |
Dan's Direct-Flam... | [265] |
SR800/SR540 Fan C... | [86] |
War on Farmers by... | [70] |
Page 1 of 2: 12
|
Connecting a raspberry pi to artists scope: no readings...
|
|
zamunda |
Posted on 06/13/2021 10:05 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello, I installed the lastest version of Artisan on a Raspberry Pi 4, my device is a Voltcraft 125-4 for reading temperatures. When I connect the same device to my Mac, the temps are shown within the Artisan I installed there. However, on the pi, I do no see any temp, the portconnection to the serial port is ok (/dev/ttyAMA0), at least no connection errors but the ET and BT within Artisan . Any ideas why? Please let me know. Thanks and regards, |
|
|
renatoa |
Posted on 06/13/2021 12:33 PM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Any chance to check errors dialog in the Help menu ? |
|
|
zamunda |
Posted on 06/13/2021 1:40 PM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello renatoa, Thanks for your reply, however, Help>Errors says: "Number of errors found 0" |
|
|
JackH |
Posted on 06/13/2021 7:11 PM
|
![]() Administrator ![]() Posts: 1809 Joined: May 10, 2011 |
Which version of Artisan are you running and distribution of PI software? One of the developers, Marko, is a member here and often helps with Artisan questions. ---Jack
KKTO Roaster. |
|
|
zamunda |
Posted on 06/14/2021 12:39 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello JackH, This is the version info: version = 2.4.4 (0) Architecture = ('32bit', 'ELF') Machine = armv7l Platform name = Linux-5.10.17-v7l+-armv7l-with-debian-10.9 Processor = Python Branch = Python Build = ('default', 'Dec 20 2019 18:57:59') Python Compiler = GCC 8.3.0 Python Implementation = CPython Python Revision = Python version = 3.7.3 Release = 5.10.17-v7l+ System = Linux Version = #1421 SMP Thu May 27 14:00:13 BST 2021 Thanks and regards |
|
|
sebiiksbcs |
Posted on 06/15/2021 10:41 AM
|
![]() Newbie ![]() Posts: 26 Joined: October 02, 2020 |
When you type 'groups' in the terminal, do you see the word 'dialout'? Are you sure it's /dev/ttyAMA0 and not e.g. /dev/ttyUSB0? (you can use the command 'ls /dev/tty*' to see all /tty serial ports) |
|
|
zamunda |
Posted on 06/16/2021 3:16 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello sebiiksbcs Thanks for your reply... Yes, that group exists: pi@roastberry:~ $ groups pi adm dialout cdrom sudo audio video plugdev games users input netdev lpadmin gpio i2c spi pi@roastberry:~ $ id uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),105(input), 109(netdev),117(lpadmin),997(gpio),998(i2c),999(spi) pi@roastberry:~ $ If I use /dev/ttyAMA0 I do not get a serial port error, anything else (like "/dev/ttyUSB0") gives me a serial connection error... So the port should be ok, however, I am lost why I do not see the temp readings within Artisan. Thanks and regards, Bert Edited by JackH on 06/16/2021 3:31 AM |
|
|
renatoa |
Posted on 06/16/2021 5:33 AM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
What about speed/baud rate... do they match ? Is this a serial over usb connection, or pure usb ? |
|
|
zamunda |
Posted on 06/16/2021 6:42 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello renatoa, This is USB-to-USB... How do I know/check if speed/baud rate match? Thanks and regards, Bert |
|
|
renatoa |
Posted on 06/16/2021 11:16 AM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Baud rate is for serial lines, I guess USB negotiate the link with the counterpart. Was curious to test in a serial monitor if TC4 reply to some simple commands. Or at least to have a low level connection error message, that Artisan is not able to catch. |
|
|
zamunda |
Posted on 06/16/2021 11:35 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Thanks again... So far, /dev/ttyAMA0 is the only port which does not give a connection error. Since Artisan expects per default a baud rate of 9600, I tried with: sudo stty -F /dev/ttyAMA0 9600 ...but that did make any difference. So I am a bit stuck. I am using a Raspberry 4, could that be a cause since I noticed that Rasp 4 has undergone some changes with regards to the serial port: https://www.raspberrypi.org/documentation/configuration/uart.md However, this is just guessing... Thanks and regards, |
|
|
renatoa |
Posted on 06/16/2021 11:51 AM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Is TC4 source compiled for 9600 then ? Because default is 115200, as I know... |
|
|
zamunda |
Posted on 06/16/2021 12:09 PM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello, I am using as device the Voltcraft 125-4, why is it that your asking for TC-4? Thanks! Bert |
|
|
renatoa |
Posted on 06/16/2021 12:34 PM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Ah... oups... senior... ![]() |
|
|
zamunda |
Posted on 06/18/2021 1:06 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello Finally, I got succes! It turned out that under the tab "modbus" I had to set the port /dev/ttyAMA0 and under the tab ET/BT the CP2102 controller. With raspi-config I have enabled the use of the serial port on beforehand. Thanks for all the support!
zamunda attached the following images:
|
|
|
JackH |
Posted on 06/18/2021 3:50 AM
|
![]() Administrator ![]() Posts: 1809 Joined: May 10, 2011 |
Quote zamunda wrote: Hello Finally, I got succes! It turned out that under the tab "modbus" I had to set the port /dev/ttyAMA0 and under the tab ET/BT the CP2102 controller. With raspi-config I have enabled the use of the serial port on beforehand. Thanks for all the support! I am glad to hear it is working. Thanks for the follow up and fix for the problem. Sorry we did not have the answer. I don't work with Linux very much. ---Jack
KKTO Roaster. |
|
|
zamunda |
Posted on 06/18/2021 10:17 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello, Now I can get the readings of the temp probes within Artisan, next step would be to get these data into a Python-script in order to trigger an action of GPIO-connected external hardware fe "slow-down fan if BT < 150 C"... Any ideas how to get access the readings within Python? Came up with this script sofar but does not give me any data: #!/usr/bin/env python import time import serial ser = serial.Serial( port='/dev/ttyAMA0', baudrate = 115200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS, timeout=0.4 ) print "Starting here" while 1: x=ser.readline() print x print "Ending here" Sorry if this is the wrong place to ask these question, if it is, please let me know. Thanks and regards, Edited by zamunda on 06/18/2021 10:32 AM |
|
|
renatoa |
Posted on 06/19/2021 2:17 AM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Serial port being already opened by Artisan... you can't share same data with other application. |
|
|
zamunda |
Posted on 06/20/2021 2:54 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello, I became beware of that, using port='/dev/ttyUSB0', So I guess my approach is wrong, is there another way to receive the temperature-data directly from Artisan? I guess Artisan writes these data somewhere in a (temporarily)-file? I noticed that a TC4 can be connected to Python-scripts, isn't this possible for commercial devices? Thanks again and regards, Bert |
|
|
renatoa |
Posted on 06/20/2021 10:00 AM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Yes, you have the Events dialog. You can have there several types of events that can trigger actions, like a command line program/script launch. The notation {} means an actual value passed as argument to that action. For example to send to TC4 a fan control command from artisan, I am selecting the Air slider, then a Serial Command Action, with the "DCFAN;{}" as the action command sent to TC4. At runtime the {} symbols will be replaced with the slider actual value, and TC4 will control the fan speed accordingly. |
|
|
zamunda |
Posted on 06/20/2021 1:53 PM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello renatoa, Thank you very much, this helps me a lot! So if I understand you right, I could do something like this (see screenshot): - Once the "ON"-button is clicked, the script "passBT.sh" is triggered and receives the BT value? How should I pass the BT-value (dynamically) to the script? Thanks again!
zamunda attached the following image:
|
|
|
renatoa |
Posted on 06/20/2021 3:11 PM
|
![]() Administrator ![]() Posts: 3279 Joined: September 30, 2016 |
Hmmm... the ON button is pressed only once, do you want to receive BT value every second ? Did you read here the whole story on this Events subject? https://artisan-s...cs/events/ |
|
|
zamunda |
Posted on 06/21/2021 2:59 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello renatoa, Thanks for that! I'll definitively have to study that since Artisan might have solutions ready under the hood I was not aware of. Let you know how it goes! Thanks again and regards, |
|
|
zamunda |
Posted on 06/25/2021 6:58 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Hello, I made some progress with the RP4 set-up with Artisan running on it: 1) First of all, I connected a AC-solid-state relay to my RP in order to be able to control external devices like fan and heater from my Pie. I used the scheme I found here: https://coffeehacks.blogspot.com/2016/02/electric-lights-and-fire-elf-raspberry.html for the relay part. Then I connected a bulb to the relay for testing and this worked. I could set the bulb to "on" with a Python script from the shell. 2) Next step was to trigger this script from within Artisan and trigger it fe with an "Alarm" if the BT arrives above a certain temperature. This also works: during "roast" when the probe gets hotter then 26C, the bulb lights up 3) Then the following step would be that the same script could pick up the BT at a certain moment with fe: /home/pi/serial/bulb-on.py {~Y1} where "bulb-on.py" is the script which gets triggered as soon BT >26 and "{~Y1}" would be the argument holding the actual BT (which should be close to 26C). The last step does not work yet, "{~Y1}" seems to be empty, isn't this the prober way of passing BT to a script? What do I miss here? Please find attached images of the diagram and scripts I used... Thanks in advance! Regards, Bert #!/usr/bin/python3 ACPin = 19 # importeer de GPIO bibliotheek. import RPi.GPIO as GPIO import sys # Zet de pinmode op Broadcom SOC. GPIO.setmode(GPIO.BCM) # Zet waarschuwingen uit. GPIO.setwarnings(False) # Zet de GPIO pin als uitgang. GPIO.setup(ACPin, GPIO.OUT) # Zet de LED uit. GPIO.output(ACPin,True) # To test the value of a pin use the .input method channel_is_on = GPIO.input(ACPin) # Returns 0 if OFF or 1 if ON if channel_is_on==1: print("Bulb is on") elif channel_is_on==0: print("Bulb is off ") # total arguments n = len(sys.argv) print("Total arguments passed:", n) # Arguments passed print("\nName of Python script:", sys.argv[0]) #Write BT to a file a_bt = sys.argv[1] file = open("BT.txt", "w") str_bt = repr(a_bt) file.write("BT = " + str_bt + "\n") file.close()
zamunda attached the following images:
Edited by zamunda on 06/25/2021 12:17 PM |
|
|
zamunda |
Posted on 06/25/2021 7:02 AM
|
![]() 1/4 Pounder ![]() Posts: 176 Joined: November 17, 2020 |
Could not add this image to the previous post somehow:
Edited by zamunda on 06/25/2021 9:47 AM |
|
Jump to Forum: |