Go to advanced search

by scootergarrett
Sat Jan 04, 2020 6:26 pm
Forum: C/C++
Topic: C code for using Adafruit Universal Thermocouple Amplifier MAX31856 Breakout
Replies: 0
Views: 160

C code for using Adafruit Universal Thermocouple Amplifier MAX31856 Breakout

I put together some C code for using the Thermocouple Amplifier https://www.adafruit.com/product/3263 with the pi. Same hook up as shown in the guide https://learn.adafruit.com/adafruit-max31856-thermocouple-amplifier/python-circuitpython . It uses the pigpio library Header file MAX31856.h: /// MAX3...
by scootergarrett
Thu Dec 26, 2019 5:13 pm
Forum: C/C++
Topic: GTK and pigpio.h level change callback
Replies: 6
Views: 309

Re: GTK and pigpio.h level change callback

Thanks a lot. I think I have the solution (still stress testing program, but its running strong for 10+ minutes). I'm using a timed callback g_timeout_add, to call a function on a time schedule, and updating the text from there. I think this keeps it in the GTK thread 'scope' (may be wrong use of sc...
by scootergarrett
Thu Dec 26, 2019 4:12 pm
Forum: C/C++
Topic: GTK and pigpio.h level change callback
Replies: 6
Views: 309

Re: GTK and pigpio.h level change callback

I made a g_thread_new that controls the display text. It updates the text every 50ms. This seems to work for longer but eventual stops working the same as before #include <stdio.h> /// IO functions #include <string.h> /// String functions #include <math.h> /// Math functions #include <stdlib.h> /// ...
by scootergarrett
Thu Dec 26, 2019 2:02 pm
Forum: C/C++
Topic: GTK and pigpio.h level change callback
Replies: 6
Views: 309

GTK and pigpio.h level change callback

I'm working on a larger project, running into issues with changing the text on a GUI based on the state of a GPIO pin. The text on the GUI changes when the state of pin 17 changes state using the gpioSetAlertFunc to call a function. After a few pin changes (not always the same amount) I get an error...
by scootergarrett
Sun Dec 15, 2019 10:36 pm
Forum: C/C++
Topic: Pi Plates C functions
Replies: 1
Views: 696

Re: Pi Plates C functions

Because WiringPi is now deprecated I went through my PiPlates code and updated to use http://abyz.me.uk/rpi/pigpio/ . Header code: // Header for using the pi plates. It's not as complete as it could be // but its a good start. It relies on the pigpio.h // at the start of the code gpioInitialise(); a...
by scootergarrett
Mon Dec 02, 2019 12:55 am
Forum: Beginners
Topic: Pi 3 Disney+ Streaming Device
Replies: 5
Views: 2368

Re: Pi 3 Disney+ Streaming Device

I would also like to see this work. I might mess around trying stuff. Mostly in an attempt to impress the GF.
by scootergarrett
Wed Jul 10, 2019 2:06 pm
Forum: Automation, sensing and robotics
Topic: Using Adafruit's Peristaltic Liquid Pump with the Pi
Replies: 9
Views: 671

Re: Using Adafruit's Peristaltic Liquid Pump with the Pi

If its going to click on and off a few times a day I would suggest a relay (https://www.amazon.com/JBtek-Channel-Module-Arduino-Raspberry/dp/B00KTEN3TM?ref_=fsclp_pl_dp_1) If its click on off a lot maybe look into a solid state relay, or a home designed circuit with a MOSFET to save some money. This...
by scootergarrett
Tue Jul 02, 2019 7:17 pm
Forum: Automation, sensing and robotics
Topic: Pi Residential Power Panel Monitoring
Replies: 5
Views: 753

Re: Pi Residential Power Panel Monitoring

What about something like this
https://www.sparkfun.com/products/299
I don't know your sampling speed but with a single 4 channel ADC, 4 x 16channel multiplexers you would have 64 channels.
just a thought
by scootergarrett
Tue May 28, 2019 12:34 pm
Forum: C/C++
Topic: printf issue on raspbian
Replies: 9
Views: 2020

Re: printf issue on raspbian

I'm thinking you need to do a "screen flush".
by scootergarrett
Fri Apr 19, 2019 7:00 pm
Forum: Troubleshooting
Topic: VNC wont start untill I move mouse pi Zero only
Replies: 2
Views: 189

VNC wont start untill I move mouse pi Zero only

I'm trying to run a pi zero headless. But the VNC wont start up until I move the mouse. I can see this when I connect it to a screen and mouse. It works fine on the Pi3B+. This didn't seem to be a problem until I updated. Any thoughts?
by scootergarrett
Sat Jan 05, 2019 9:50 pm
Forum: C/C++
Topic: Pi Plates C functions
Replies: 1
Views: 696

Pi Plates C functions

With some help from https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=229685 . I was able to start a library of functions to run the DAC and the Relay pi plates https://pi-plates.com/ . I went through the python code an translated into basic C. The functions have the same form (argument order)...
by scootergarrett
Wed Dec 26, 2018 8:56 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

fbe I think you got it. when I use SPIComPort = wiringPiSPISetup(1, 250000); with wiringPiSPIDataRW(1, Send, SendCount); its behaving as I would expect. Now that I take 2 seconds and look that the first argument in wiringPiSPIDataRW is 'channel'. Its intresting that it was working with: SPIComPort =...
by scootergarrett
Wed Dec 26, 2018 7:42 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

Thanks for confirming.
by scootergarrett
Wed Dec 26, 2018 5:40 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

I made a torn down program with the same behavior // PlateDemo.c // This program is for testing the raspberry pi SPI control // more specificity the setting up which chip select pin to use (CE0 or CE1) #include <stdio.h> /// IO functions #include <time.h> /// Used for delay function #include <wiring...
by scootergarrett
Wed Dec 26, 2018 4:24 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

I get the same behavior using a pi zero
by scootergarrett
Mon Dec 24, 2018 9:37 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

So I have unplugged the pi plate and directly plugged in a logic analyzer (https://www.sparkfun.com/products/13929). If I use: com = wiringPiSPISetup(0, 250000); ... wiringPiSPIDataRW(com, arg, 4); I see data as expected (clock, chip select at CE0, and MOSI) but if I change to: com = wiringPiSPISetu...
by scootergarrett
Mon Dec 24, 2018 8:47 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

Yes you are correct com = wiringPiSPISetup(1, 250000); doesn't use the SPI1, but it also doesn't seem to change the chip select from CE0 to CE1, in fact when I probe around I don't see anything. The wiring pi documentation (http://wiringpi.com/reference/spi-library/) call that field 'channel' int wi...
by scootergarrett
Mon Dec 24, 2018 8:22 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Re: Wirring pi and SPI communication

There seem to be 2 completely different SPI's. SPI0 and SPI0. So 0 indicates I'm using SPI0
by scootergarrett
Mon Dec 24, 2018 7:59 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2707

Wirring pi and SPI communication

I'm trying to rewrite the Python functions for the pi plates (https://pi-plates.com/) I can probe at the SPI pins and see what is happening with working python code. The working python code seems to use CE1 for the chip select. When I try to recreate the SPI calls using the wiringpi libraries it use...
by scootergarrett
Mon Dec 24, 2018 7:43 pm
Forum: Python
Topic: View python import code
Replies: 3
Views: 844

Re: View python import code

Thanks that helped a lot. But I'm still a little unsure what is happining when at this line import piplates.DAQCplate as DAQC I think it is doing a littl bit more than just this: GPIO.setmode(GPIO.BCM) GPIObaseADDR=8 ppFRAME = 25 ppINT = 22 GPIO.setup(ppFRAME,GPIO.OUT) GPIO.setup(ppINT, GPIO.IN, pul...
by scootergarrett
Sun Dec 23, 2018 10:23 pm
Forum: Python
Topic: View python import code
Replies: 3
Views: 844

View python import code

So I'm trying to dissect the python code used with the pi plates (https://pi-plates.com/). I'm able to use the inspect library to view the code for functions e.g: print inspect.getsource(DAQC.getDINbit) results def getDINbit(addr,bit): VerifyADDR(addr) VerifyDINchannel(bit) resp=ppCMD(addr,0x20,bit,...
by scootergarrett
Sat Jun 30, 2018 12:06 pm
Forum: Networking and servers
Topic: Mounting shared network folder with mount R/W access
Replies: 5
Views: 2063

Re: Mounting shared network folder with mount R/W access

Nice. adding 'vers=1.0' worked. Note that after the password there is a comma then no space

Code: Select all

sudo mount.cifs //<IP>/public /home/pi/Shared/ -o username=pi,password=<PW>,vers=1.0
now I need to make sure it works on all older pies

Thanks so much
by scootergarrett
Sat Jun 30, 2018 11:12 am
Forum: Networking and servers
Topic: Mounting shared network folder with mount R/W access
Replies: 5
Views: 2063

Re: Mounting shared network folder with mount R/W access

The mount command I'm using is: sudo mount.cifs //<IP>/public /home/pi/Shared/ -o user=pi,password=<PW> where <IP> is the IP address of the server pi, and <PW> is the samba password. In the future I may want to use a windows computer. but for my understanding the sshfs would act just like a networke...
by scootergarrett
Sat Jun 30, 2018 1:04 am
Forum: Networking and servers
Topic: Mounting shared network folder with mount R/W access
Replies: 5
Views: 2063

Mounting shared network folder with mount R/W access

I have a raspberry pi set up sharing a network folder using samba. I can access files via my (Linux) lap top and used to access from other pi's via the mount command. I got the new Pi 3B+ and had to update Jessie, now when I mount the folder I only have read access. I doubt its the pi with the share...
by scootergarrett
Tue May 01, 2018 12:33 am
Forum: Troubleshooting
Topic: Pi zero W as wifi host
Replies: 0
Views: 222

Pi zero W as wifi host

In the past I have used this tutorial https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/overview to get the pi set up as a wifi host. I worked through it on a pi 3. But now when I put the card into a pi zero W it shows up as a wifi network but I can't connecto to it. I have...

Go to advanced search