Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
Need the latest SmartSDR, Power Genius, Tuner Genius and Antenna Genius Software?
SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
node red rookie questions
joe camilli
Member ✭✭
i am trying to understand how to use node-red to control a SainSmart
16-Channel 12V Relay Module using a Raspberry Pi over i2c. Using the following i2c interface:
Controlling it with Python
16-Channel 12V Relay Module using a Raspberry Pi over i2c. Using the following i2c interface:
- https://www.iascaled.com/store/RPi/RPiIO/I2C-RELAY16
- https://www.iascaled.com/store/RPi/RPiAdapters/RPI-5VI2C
Controlling it with Python
When it comes to scripting languages, python’s really hard to beat. It’s simple, quick, and you can do almost anything with “import some-module”.
In this case, I’ve made a class called “relay16” – it’s a really simple wrapper around the smbus calls needed to run the PCA9671 part on the I2C-RELAY16 board. The example code is in the src/RasPi-Python subdirectory of the I2C-RELAY16’s Github project.
Let’s start with the very minimum amount you need to make this work:
#!/usr/bin/python import smbus import relay16 import time bus = smbus.SMBus(1) address = 0x20 relayBoard = relay16.relay16(bus, address) relayBoard.setRelay(1) time.sleep(1) relayBoard.clearRelay(1)
1
Answers
-
is this Flex related?? not understanding0
-
Yes the relay switch will be used for my 2x6 matrix antenna switch for use on my 6600
0 -
https://github.com/rn3kk/RemoteSwitcher 16 reLay, web server. All done.1
-
SainSmart boards are Junk , 2 returned. Fyi0
-
Joe, you can find more Node Red info and help in the Node Red Thread located here.
https://community.flexradio.com/flexradio/topics/remote-operating-and-node-red
I am using an 8 channel SainSmart relay to control my Six Pak antenna switch. It is connected directly to my Flex 6600M via usb cable. I've had no issues with my relay board. Works great !
Joe
N3HEE
1 -
We have been supporting Node-Red integration for projects just like this for remote station operation. There is an entire thread regarding it as other have posted.
Bob, while I appreciate you are trying to be funny, please take a movement and delete your recipe.
Mike0 -
Joe
What I would do first is to get this working outside of Node-Red with your python scripts. Once you have that part playing well, you should then be able to call the script from within Node-Red with the ‘exec’ I think.
I don’t have one to test with, so I can’t help you out much unless I order the board to play with. My i2c experience is pretty limited to I hook it up and pray it works. . That being said, I do have 6 temperature gauges on i2c on my Flex 6000 remote control interface.
We do have lots of customers using SainSmart devices directly connected to the 6000 series radios with wonderful success. Others can comment if they have some experience.
Mike
2 -
Thanks for the link. Appreciated.
0 -
Michael,
thanks for the feedback. yes i have the relay working just fine using a python program. The use of i2c in way easier than GPIO.
Joe N7QPP
0 -
Have you now also got Node-Red able to control it by calling your python script?
As for easier, etc. I guess it it based on your comfort level.
All my Relays are TCP connected to external to the RPI. That way, if I need to reboot the RPI, the relays don't toggle and shutdown other things in the process.
Mike0 -
I use FOX delta RUSS board and KMtronics, does not cycle of relays, I have couple connected to the ALS1300 amp , power on and another relay for operate/standby , the sainsmart boards cycle, the two work sometimes then it would disappear, restart the computer, work couple more times then it will lock the relay on .0
Leave a Comment
Categories
- All Categories
- 289 Community Topics
- 2.1K New Ideas
- 530 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 146 SmartSDR for Maestro and M models
- 358 SmartSDR for Mac
- 249 SmartSDR for iOS
- 230 SmartSDR CAT
- 171 DAX
- 352 SmartSDR API
- 8.7K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 20 FLEX-8000 Signature Series
- 841 Maestro
- 43 FlexControl
- 847 FLEX Series (Legacy) Radios
- 793 Genius Products
- 415 Power Genius XL Amplifier
- 277 Tuner Genius XL
- 101 Antenna Genius
- 243 Shack Infrastructure
- 166 Networking
- 404 Remote Operation (SmartLink)
- 130 Contesting
- 630 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 869 Third-Party Software