topbanner.gif
Login
Username

Password




Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

renatoa
04/18/2024 12:36 AM
bijurexim, greyberry2, N C, welcome2

renatoa
04/17/2024 9:27 AM
morning, branchu

renatoa
04/14/2024 5:56 AM
TheOtherJim and papajim, welcome to forum !

allenb
04/11/2024 6:33 PM
Zemona Welcome

renatoa
04/11/2024 9:19 AM
Mrbones and sgupta, coffee drink ?

In Memory Of Ginny
Donations

Latest Donations
dmccallum - 10.00
JackH - 25.00
snwcmpr - 10.00
Anonymous - 2.00
Anonymous - 5.00
Users Online
Guests Online: 1

Members Online: 0

Total Members: 8,211
Newest Member: bijurexim

View Thread

Who is here? 1 guest(s)
 Print Thread
Connecting a raspberry pi to artists scope: no readings...
zamunda
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
Any chance to check errors dialog in the Help menu ?
 
zamunda
Hello renatoa,

Thanks for your reply, however, Help>Errors says: "Number of errors found 0"
 
JackH
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
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
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
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
What about speed/baud rate... do they match ?
Is this a serial over usb connection, or pure usb ?
 
zamunda
Hello renatoa,

This is USB-to-USB...
How do I know/check if speed/baud rate match?

Thanks and regards,
Bert
 
renatoa
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
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
Is TC4 source compiled for 9600 then ?
Because default is 115200, as I know...
 
zamunda
Hello,

I am using as device the Voltcraft 125-4, why is it that your asking for TC-4?

Thanks!
Bert
 
renatoa
Ah... oups... senior... Grin
 
zamunda
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:
screenshot_2021-06-18_at_080442.png screenshot_2021-06-18_at_080356.png screenshot_2021-06-18_at_080341.png screenshot_2021-06-18_at_080324.png
 
JackH

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
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
Serial port being already opened by Artisan... you can't share same data with other application.
 
zamunda
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
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
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:
screen_shot_2021-06-20_at_204729.png
 
renatoa
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
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
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:
roaster_schematic.png bbb.jpeg

Edited by zamunda on 06/25/2021 12:17 PM
 
zamunda
Could not add this image to the previous post somehow:
Edited by zamunda on 06/25/2021 9:47 AM
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Unable to get Artisan Scope's PID to control heating Dataloggers/Controllers/Rate of Rise Meters 4 08/01/2023 9:11 AM
Raspberry+artisan Bread Machine Roasters 8 03/08/2023 1:06 PM
Using a TC4 with Artisan Roaster Scope Dataloggers/Controllers/Rate of Rise Meters 41 05/09/2022 12:06 PM
TC4 connect to Raspberry Pi Dataloggers/Controllers/Rate of Rise Meters 55 01/04/2022 5:42 PM
How to get accurate temp readings MY FIRST ROASTER 5 01/07/2021 2:29 AM
Homeroasters Association Logo, and all Content, Images, and Icons © 2005-2016 Homeroasters Association - Logos are the property of their respective owners.
Powered by PHP-Fusion Copyright © 2024 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX
Hosted by skpacman