Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues getting node to work #1

Open
slogan87 opened this issue May 6, 2020 · 14 comments
Open

Issues getting node to work #1

slogan87 opened this issue May 6, 2020 · 14 comments
Assignees

Comments

@slogan87
Copy link

slogan87 commented May 6, 2020

Hi there,

I have just downloaded you Node to run on my Raspberry Pi. I am currently trying to create my own brewery controller. I have been using another program on the Pi and have everything wired. My MOSI, MISO and CLK are connected to 10, 9 and 11. I also have 4 PT100's with 4 board that I have currently working but am struggling to get it working with your node. Are you able to help?

Kind Regards,
Sam

@MelvinRook MelvinRook self-assigned this May 6, 2020
@MelvinRook
Copy link
Owner

Hey Sam,

Let's figure out what's happening. Could you please take the following steps:

  1. Create a workflow in Node-RED with an input trigger connected to the MAX31865 and a debug output to see if anything happens when you trigger.
  2. Simplify your setup and connect and configure only a single sensor. Once that works, add the other sensor boards one by one.

Otherwise we should setup a screen sharing call, so I can look with you.

@slogan87
Copy link
Author

slogan87 commented May 6, 2020

Hi Melvin,

Firstly thank you for your offer to help.

I can certainly do that. I am not sure what the bus digits I should be using are. I have them current set at 0 and 0.

Also how do I account for the fact my cs is connected to gpio 19 and my miso, mosi and clk are as per my first message.

@MelvinRook
Copy link
Owner

ls -l /dev/spidev* should give you an indication of the bus digits. With a single board there should be only one device listed.

Regarding the wiring, let's start with connecting board CS to Pi SPI0 CE0 (BCM 8): https://pinout.xyz/pinout/pin24_gpio8

Once we got the basics working, we'll play around with different setups to achieve your final goal.

@slogan87
Copy link
Author

Hi Melvin,

Sorry it has taken a while to get back to you. I have been a bit busy. I have changed everything as per the layout above and I am getting

"TypeError [ERR_INVALID_ARG_TYPE]: The "value" argument must not be of type number. Received type number"

I am also getting a temp however that is -242.02.

Any ideas? It is working through craftbeerpi and reading correctly.

Regards
Sam

@MelvinRook
Copy link
Owner

Make sure craftbeerpi isn't running at the moment you are running the node.

A reading of -242.02 sounds like there is a reading, but CS going wrong, or a configuration error in the board settings (resistance or wires).

@slogan87
Copy link
Author

That worked thanks. I did a complete reinstall of raspbian. Now do you think there is anyway I can have 4 pt100’s working? There is a python script to do it for craftbeerpi but I have no idea program.

Kind Regards
Sam

@MelvinRook
Copy link
Owner

MelvinRook commented May 13, 2020

I believe we can get it working. Key is to achieve that step-by-step.

Let's add the second board.

Have them share the SPI0 MOSI, MISO and SCLK pins. Then assign the first board the SPI0 CE0 pin and the second board the SPI0 CE1 pin.

ls -l /dev/spidev* should give you an indication of the bus digits. Then configure the 2nd board in Node-RED and make sure it works.

If that works continue step-by-step with the 3rd board:

Note that these boards will be connected to SPI1 instead of SPI0.

  • Pi 3V3 to sensor VIN
  • Pi GND to sensor GND
  • Pi SPI1 MOSI to sensor SDI
  • Pi SPI1 MISO to sensor SDO
  • Pi SPI1 SCLK to sensor CLK
  • Pi SPI1 CE0 to sensor CS

And repeat all the checks to get it working in Node-RED.

Adding the 4th:

Have them share the SPI1 MOSI, MISO and SCLK pins. Then assign the third board the SPI1 CE0 pin and the fourth board the SPI1 CE1 pin.

Hope this works! :-)

@slogan87
Copy link
Author

Thanks for your reply Melvin.

I can certainly get the second one going on CE1 of the SPI0 bus, however I am unable to use the SPI1 bus. This is because it is running quiet a complicated brewery with valve and pump control and I am using all of the IO on the Pi, so I am unable to use those pins as they are assigned to other devices and I have no room to shift them. With Craftbeerpi, the guy who wrote the plugin, managed to get flexible cs pin assignment meaning you could have more that 2 Max31685 boards on the SPI0 bus.

Regards,
Sam

@yurilq
Copy link

yurilq commented Sep 21, 2020

good afternoon, I have this code in python that runs

Simple demo of the MAX31865 thermocouple amplifier.
Will print the temperature every second.


import time

import board
import busio
import digitalio

import adafruit_max31865

  • Initialize SPI bus and sensor.
    spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
    cs = digitalio.DigitalInOut(board.D5) # Chip select of the MAX31865 board.
    sensor = adafruit_max31865.MAX31865(spi, cs)

  • Note you can optionally provide the thermocouple RTD nominal, the reference

  • resistance, and the number of wires for the sensor (2 the default, 3, or 4)

  • with keyword args:

  • sensor = adafruit_max31865.MAX31865(spi, cs, rtd_nominal=100, ref_resistor=430.0, wires=2)

  • Main loop to print the temperature every second.
    while True:

    • Read temperature.
      temp = sensor.temperature
      *Print the value.
      print("Temperature: {0:0.3f}C".format(temp))
    • Delay for a second.
      time.sleep(1.0)
      print('Resistance: {0:0.3f} Ohms'.format(sensor.resistance))
      time.sleep(1.0)

however the node-red node returns me a value -212.02

@yurilq
Copy link

yurilq commented Sep 21, 2020

nodered

@MelvinRook
Copy link
Owner

@yurilq Let's figure out what's happening. Could you please try the following:

Create a workflow in Node-RED with an input trigger connected to the MAX31865 and a debug output to see if anything happens when you trigger.

Also, please let me know the settings of your MAX31865 node.

@MelvinRook
Copy link
Owner

Thanks for your reply Melvin.

I can certainly get the second one going on CE1 of the SPI0 bus, however I am unable to use the SPI1 bus. This is because it is running quiet a complicated brewery with valve and pump control and I am using all of the IO on the Pi, so I am unable to use those pins as they are assigned to other devices and I have no room to shift them. With Craftbeerpi, the guy who wrote the plugin, managed to get flexible cs pin assignment meaning you could have more that 2 Max31685 boards on the SPI0 bus.

Regards,
Sam

@slogan87 Sorry, missed this comment. Will check if I can implement flexible CS pin assignment on the SPI0 bus (or any bus).

@yurilq
Copy link

yurilq commented Oct 4, 2020

@yurilq Vamos descobrir o que está acontecendo. Você poderia tentar o seguinte:

Crie um fluxo de trabalho no Node-RED com um acionador de entrada conectado ao MAX31865 e uma saída de depuração para ver se algo acontece quando você aciona.

Além disso, informe-me sobre as configurações do seu nó MAX31865.

node on the noder-red server

erro nodered

node configuration

image

@yurilq
Copy link

yurilq commented Oct 4, 2020

to be able to use I'm using the example in python and saving to a CSV, so I read this file but I would like to use only node-red resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants