Jump to content

MarkTilles

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by MarkTilles

  1. Well, in summary after reviewing it all, the only programming changes were a spelling correction and addition of some variables to system calls in oven.py and adding config variables accordingly to config.py. The rest of my problems were my hardware miss-wiring. Note: The following GPIO pinouts below are defined for my Raspberry Pi Zero W (and I left gpio.heat alone). Mark's config.py gpio_sensor_cs = 5 gpio_sensor_clock = 11 gpio_sensor_data = 9 ### MARK ADDED ### gpio_sensor_di = 10 Original config.py gpio_sensor_cs = 27 gpio_sensor_clock = 22 gpio_sensor_data = 17 Here is the original oven.py section that needed changing: if config.max31856: log.info("init MAX31856") from max31856 import MAX31856 software_spi = { 'cs': config.gpio_sensor_cs, 'clk': config.gpio_sensor_clock, 'do': config.gpio_sensor_data } self.thermocouple = MAX31856(tc_type=config.thermocouple_type, software_spi = sofware_spi, units = config.temp_scale ) And here is the corrected section: if config.max31856: log.info("init MAX31856") from max31856 import MAX31856 software_spi = { 'cs': config.gpio_sensor_cs, 'clk': config.gpio_sensor_clock, 'do': config.gpio_sensor_data, ### MARK TILLES ADDED 'di': config.gpio_sensor_di, 'gpio': config.gpio_heat } self.thermocouple = MAX31856(tc_type=config.thermocouple_type, software_spi = software_spi, units = config.temp_scale ) I began with the Raspberry Pi OS (32 bit) with desktop. Here are the steps I performed to install the software. I had no notable installation issues: sudo apt-get install python3-pip python3-virtualenv libevent-dev git virtualenv git clone https://github.com/jbruce12000/kiln-controller.git cd kiln-controller virtualenv -p python3 venv source venv/bin/activate pip install --upgrade setuptools pip install greenlet bottle gevent gevent-websocket pip install -r requirements.txt pip install adafruit-circuitpython-max31856 pip install adafruit-blinka Now, whether something I installed above might not have been needed, that I can't answer... I'm just glad the it worked! I have an added a photo of a marked-up drawing showing my GPIO connections. Note: the positions on the big connector are wrong! This picture is only for reference for the GPIO numbers.
  2. Well it could be better, but I am running from my garage through two walls with only about 6 m between the buildings. However it is connecting to a repeater which really doesn’t give a good connection to anything outside the house. So it’s kind of hard to tell. But it has one available USB port, you could always add an external USB Wi-Fi card, I’ve tried that and that works a little better.
  3. The most obvious culprit was my using the wrong GPIO numbers (ha ha I was defining the pin numbers in config.py and not the GPIO numbers), but before I got there in order to get the kiln controller even up and running I also had to add a couple of variables into a pair of definition statements in oven.py - the values for “di” - the SDI pin on the max 31856, that was missing from the library calls. I will run a compare on the before and after to determine the exact changes I made, I will post this later.
  4. Gentlemen and all you lovely ladies, and especially @jbruce, @leof, @Bill Kielb, @newps and anyone else - if any are reading this: SUCCESS! After a calm-down of my thoughts and a collecting of my notes, using what I have learned and debugged in the Python code with my friend "Google's" help ... the system is up! Hurrah! Very pleased here! Now I just need to CLONE the simm card so I have a backup I will write up a document with all my notes of what I have done, my exact wiring layout on my Raspberry pi zero W, replicate it on another fresh simm card, then post it back here for someone to figure out how to adjust the code base properly. I'm soooooo happy! Thanks for all the guidance!!! HURRAH!!!!!
  5. Thanks a million to each an every one of you for your assistance, but I am just too much of an amateur to manage to handle this on my own. I am wracking my brain to understand, and I've learned plenty, but only enough to make a mess of things. I know a python programmer fellow here that hopefully will have time soon to grip on this with me. In the meanwhile I will focus on rearranging the kilns in my space, interlocking the SSR relay unit to power the heating elements, and get my controller box installed and ready to accept the Pi and 31856 sensor card combo. Mark
  6. Some progress! The service starts and my SSR is now cycling on and off repetitively, but I had to add a line to the oven.py for the pi MOSI to max31856 sensor SDI terminal: if config.max31856: log.info("init MAX31856") from max31856 import MAX31856 # CHANGED FROM max31856 import MAX31856, MAX31856Error software_s = { 'cs': config.gpio_sensor_cs, 'clk': config.gpio_sensor_clock, 'do': config.gpio_sensor_data, 'di': config.gpio_sensor_di } self.thermocouple = MAX31856(tc_type=config.thermocouple_type, software_spi = software_s, units = config.temp_scale ) Here are my pinout definitions in config.py ### MARKS DATA RASPBERRY PI ZERO W gpio_sensor_cs = 29 gpio_sensor_clock = 23 gpio_sensor_data = 21 gpio_sensor_di = 19 and strangely enough, the server starts now without errors. However, the temperature bounces all over the place from minus to plus numbers ... and the test script that used to work and respond to warming the cooling of the thermocouple doesn't work anymore...? Traceback (most recent call last): File "../../max31856simpletest.py", line 4, in <module> import board ModuleNotFoundError: No module named 'board'
  7. OK, I installed the library, here is the info: (venv) pi@raspberrypi:~/kiln-controller $ sudo apt-get install rpi.gpio Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python-rpi.gpio-dbgsym' for regex 'rpi.gpio' Note, selecting 'python3-rpi.gpio' for regex 'rpi.gpio' Note, selecting 'rpi.gpio-common' for regex 'rpi.gpio' Note, selecting 'python-rpi.gpio' for regex 'rpi.gpio' Note, selecting 'python3-rpi.gpio-dbgsym' for regex 'rpi.gpio' python-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4). python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4). rpi.gpio-common is already the newest version (0.7.0-0.1~bpo10+4). rpi.gpio-common set to manually installed. The following NEW packages will be installed: python-rpi.gpio-dbgsym python3-rpi.gpio-dbgsym 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 88.2 kB of archives. After this operation, 126 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://archive.raspberrypi.org/debian buster/main armhf python-rpi.gpio-dbgsym armhf 0.7.0-0.1~bpo10+4 [42.7 kB] Get:2 http://archive.raspberrypi.org/debian buster/main armhf python3-rpi.gpio-dbgsym armhf 0.7.0-0.1~bpo10+4 [45.5 kB] Fetched 88.2 kB in 0s (344 kB/s) Selecting previously unselected package python-rpi.gpio-dbgsym. (Reading database ... 98720 files and directories currently installed.) Preparing to unpack .../python-rpi.gpio-dbgsym_0.7.0-0.1~bpo10+4_armhf.deb ... Unpacking python-rpi.gpio-dbgsym (0.7.0-0.1~bpo10+4) ... Selecting previously unselected package python3-rpi.gpio-dbgsym. Preparing to unpack .../python3-rpi.gpio-dbgsym_0.7.0-0.1~bpo10+4_armhf.deb ... Unpacking python3-rpi.gpio-dbgsym (0.7.0-0.1~bpo10+4) ... Setting up python3-rpi.gpio-dbgsym (0.7.0-0.1~bpo10+4) ... Setting up python-rpi.gpio-dbgsym (0.7.0-0.1~bpo10+4) ... -------------------------------- This is what I got for first option (removing the line): 2021-04-18 17:49:43,819 INFO kiln-controller: Starting kiln controller 2021-04-18 17:49:43,954 INFO kiln-controller: this is a real kiln 2021-04-18 17:49:43,956 INFO oven: import MAX31856 2021-04-18 17:49:43,959 INFO oven: init MAX31856 Traceback (most recent call last): File "../kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 317, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 113, in __init__ units = config.temp_scale File "/home/pi/kiln-controller/lib/max31856.py", line 128, in __init__ 'Must specify either spi for for hardware SPI or clk, cs, and do for softwrare SPI!') ValueError: Must specify either spi for for hardware SPI or clk, cs, and do for softwrare SPI! ---------------------- What I got with the second option, setting =1: (venv) pi@raspberrypi:~/kiln-controller/lib $ ../kiln-controller.py 2021-04-18 17:52:26,286 INFO kiln-controller: Starting kiln controller 2021-04-18 17:52:26,423 INFO kiln-controller: this is a real kiln 2021-04-18 17:52:26,430 INFO oven: import MAX31856 2021-04-18 17:52:26,432 INFO oven: init MAX31856 Traceback (most recent call last): File "../kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 317, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 113, in __init__ units = config.temp_scale File "/home/pi/kiln-controller/lib/max31856.py", line 123, in __init__ gpio = Adafruit_GPIO.get_platform_gpio() File "/home/pi/kiln-controller/venv/lib/python3.7/site-packages/Adafruit_GPIO/GPIO.py", line 417, in get_platform_gpio import RPi.GPIO ModuleNotFoundError: No module named 'RPi' ------------------- And third option, once I noticed and replaced the missing "t" in sofware, (venv) pi@raspberrypi:~/kiln-controller/lib $ ../kiln-controller.py 2021-04-18 17:54:45,567 INFO kiln-controller: Starting kiln controller 2021-04-18 17:54:45,631 INFO kiln-controller: this is a real kiln 2021-04-18 17:54:45,633 INFO oven: import MAX31856 2021-04-18 17:54:45,635 INFO oven: init MAX31856 Traceback (most recent call last): File "../kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 330, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 115, in __init__ units = config.temp_scale File "/home/pi/kiln-controller/lib/max31856.py", line 123, in __init__ gpio = Adafruit_GPIO.get_platform_gpio() File "/home/pi/kiln-controller/venv/lib/python3.7/site-packages/Adafruit_GPIO/GPIO.py", line 417, in get_platform_gpio import RPi.GPIO ModuleNotFoundError: No module named 'RPi'
  8. With your first suggestion, the error shifts to: (venv) pi@raspberrypi:~/kiln-controller/lib $ ../kiln-controller.py 2021-04-18 17:27:05,728 INFO kiln-controller: Starting kiln controller 2021-04-18 17:27:05,867 INFO kiln-controller: this is a real kiln 2021-04-18 17:27:05,879 INFO oven: import MAX31856 2021-04-18 17:27:05,882 INFO oven: init MAX31856 Traceback (most recent call last): File "../kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 329, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 125, in __init__ units = config.temp_scale File "/home/pi/kiln-controller/lib/max31856.py", line 123, in __init__ gpio = Adafruit_GPIO.get_platform_gpio() File "/home/pi/kiln-controller/venv/lib/python3.7/site-packages/Adafruit_GPIO/GPIO.py", line 417, in get_platform_gpio import RPi.GPIO ModuleNotFoundError: No module named 'RPi' ------------------------------ With your second suggestion instead, (venv) pi@raspberrypi:~/kiln-controller/lib $ ../kiln-controller.py 2021-04-18 17:22:56,772 INFO kiln-controller: Starting kiln controller 2021-04-18 17:22:56,885 INFO kiln-controller: this is a real kiln 2021-04-18 17:22:56,894 INFO oven: import MAX31856 2021-04-18 17:22:56,900 INFO oven: init MAX31856 Traceback (most recent call last): File "../kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 329, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 114, in __init__ software_spi = sofware_s, NameError: name 'sofware_s' is not defined (venv) pi@raspberrypi:~/kiln-controller/lib $
  9. Jason Bruce didn’t have the 31856 interface card when he wrote the additional code for it, so he wasn’t able to test it. (venv) pi@raspberrypi:~/kiln-controller $ ./kiln-controller.py 2021-04-18 13:58:04,515 INFO kiln-controller: Starting kiln controller 2021-04-18 13:58:04,562 INFO kiln-controller: this is a real kiln 2021-04-18 13:58:04,565 INFO oven: import MAX31856 2021-04-18 13:58:04,569 INFO oven: init MAX31856 Traceback (most recent call last): File "./kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 317, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 112, in __init__ software_spi = sofware_spi, NameError: name 'sofware_spi' is not defined
  10. I’m out of the house for a few hours at the model airplane field, when I get home I can paste the error, it has something to do with the software_SPI definition? Everything is being run in a virtual environment for the oven. (and running the test script only works in the virtual environment). Jason Bruce didn’t have the 31856 interface card when he wrote the additional code for it, so he wasn’t able to test it.
  11. Leof, you seem to be quite proficient with python, which I am not, if you are willing I could give you a login to my system and you could take a look around and maybe quickly figure out what is wrong. I’d really appreciate it! I am so very close now. If so, email me at my email Markt3@tilles.net. Thanks!
  12. Thank you but don't put any effort in yet, I need to rebuild a clean system. Then we can look into it. I'm just glad to see I can get feedback from the hardware and test script (although it ppb assumes a K-type for the test and I have an S-type attached), but nevertheless, I'm able to see the hardware is reacting to warming and cooling of the thermocouple.
  13. I HAVE FUNCTIONAL HARDWARE! THANK YOU LEOF! Got a result back from the simple test script. Now, to be able to create a fresh and new install on another card so I have a clean system (I've been piddling with many items in the system) but it was the correct pinouts that make a difference! Thanks again!
  14. I have followed the wiring diagram in jbruce's original docs for the 31855 ... I'm presuming the wiring for the 31856 follows the same convention? Or maybe that's my issue. When I copied the max31856.py library to the same folder as the test_MAX31856.py script I downloaded from the github site, the script ran but this was the output ... no connection to the hardware at all it seems. Maybe I need to wash my car today instead and wait until a python programmer buddy here has time to look at it: test_MAX31856.py:39: RuntimeWarning: No channels have been set up yet - nothing to clean up! Try cleaning up at the end of your program instead! GPIO.cleanup() FFFF.. ====================================================================== FAIL: test_get_internal_temperaure_reading (__main__.Adafruit_MAX31856) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_MAX31856.py", line 144, in test_get_internal_temperaure_reading self.assertTrue(False) AssertionError: False is not true ====================================================================== FAIL: test_get_internal_temperaure_reading_k_type (__main__.Adafruit_MAX31856) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_MAX31856.py", line 161, in test_get_internal_temperaure_reading_k_type self.assertTrue(False) AssertionError: False is not true ====================================================================== FAIL: test_get_register_reading (__main__.Adafruit_MAX31856) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_MAX31856.py", line 95, in test_get_register_reading self.assertTrue(False) AssertionError: False is not true ====================================================================== FAIL: test_get_temperaure_reading (__main__.Adafruit_MAX31856) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_MAX31856.py", line 127, in test_get_temperaure_reading self.assertTrue(False) AssertionError: False is not true ---------------------------------------------------------------------- Ran 6 tests in 0.293s FAILED (failures=4)
  15. Forgot a few important wires ... nope, no change fully wired. Don't think it's a filename problem. Will see if any of our Python friends can debug.
  16. OK, @jbruceI FINALLY got my max31856 card and have plugged it in now. All cables connected. I set Simulation=False and enabled 31856, but get this error on startup. Seems to be a software and not hardware issue. Any ideas anyone? (venv) pi@Raspberry-1:~/kiln-controller $ source venv/bin/activate; ./kiln-controller.py 2021-04-17 00:05:14,369 INFO kiln-controller: Starting kiln controller 2021-04-17 00:05:14,391 INFO kiln-controller: this is a real kiln 2021-04-17 00:05:14,393 INFO oven: import MAX31856 2021-04-17 00:05:14,396 INFO oven: init MAX31856 Traceback (most recent call last): File "./kiln-controller.py", line 44, in <module> oven = RealOven() File "/home/pi/kiln-controller/lib/oven.py", line 311, in __init__ self.board = Board() File "/home/pi/kiln-controller/lib/oven.py", line 46, in __init__ self.create_temp_sensor() File "/home/pi/kiln-controller/lib/oven.py", line 74, in create_temp_sensor self.temp_sensor = TempSensorReal() File "/home/pi/kiln-controller/lib/oven.py", line 107, in __init__ from max31856 import MAX31856, MAX31856Error ImportError: cannot import name 'MAX31856Error' from 'max31856' (/home/pi/kiln-controller/lib/max31856.py) (venv) pi@Raspberry-1:~/kiln-controller $
  17. Maybe I should clarify, I have two kilns but can only run one at a time. Just one 3-phase 16A circuit in my garage! Not planning on flipping over live to check each kiln...
  18. However, I want to put this double pole double throw switch in the loop, since I want to have one raspberry controller to control either of my two kilns. I guess I can do some testing and see how this affects things, but this will be within the residential room where we work, not where the space is getting heated. Compensation cable all the way to the raspberry card. Problem?
  19. Then here’s a nitty-gritty question, should I solder in the screw terminal block, or should I solder the new compensation cable directly to the board?
  20. Quick question, the terminal block of the thermocouple is of course outside the kiln in a much cooler environment. Previously when I was using the wrong cable I was getting measurement drift at high temperatures when I compared the temperature on my PID to the temperature on control panel of the kiln itself. You see, I have two thermal couples in this Kiln, the built-in and one I added. I want to have a secondary system for overheat protection and temperature comparison. Are these discrepancies likely because I simply had the wrong cable in place?
  21. Thank you for the confirmation! It feels good to know that I’m starting to know what I’m doing :-) And I only bought 25 m because that was the smallest rol they sold
  22. Bill, my kilns here in Sweden as well as my accessory thermocouples I am using with my PID controllers are S-type. I just bought 25 meters of cable from RS components, “IEC PVC insulated flat pair extension and compensating cable” ... “type U (RCA) 7/0.2mm for R/S thermocouples”. My thermocouples look to have stainless steel screw terminal mounts. Hopefully this was the right material for me to purchase!?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.