Go to advanced search

by IanH
Tue May 29, 2018 9:47 pm
Forum: Python
Topic: I need to read from serialport
Replies: 7
Views: 656

Re: I need to read from serialport

In the photo you appear to be using a Raspberry Pi 3, and /dev/ttyAMA0 on the 3 is a Bluetooth serial port, not the wired one. Instead, you need to now use /dev/ttyS0 . There are some more useful answers here: https://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-ras...
by IanH
Sun Sep 25, 2016 7:08 am
Forum: Python
Topic: Running a bash command from python with arguments
Replies: 5
Views: 1639

Re: Running a bash command from python with arguments

... call(["MP4Box", "-add", input_video, output_video]) You'll need this from subprocess import call at the top of the file. If you want to check whether the call has worked, do something like this: retcode = call(["MP4Box", "-add", input_video, output_video]) if retcode != 0: # It went wrong... pr...
by IanH
Tue May 03, 2016 9:55 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: [Solved] MCP3002 returns 0.0 everytime
Replies: 13
Views: 2181

Re: MCP3002 returns 0.0 everytime

Have you set

Code: Select all

dtparam=spi=on
in the Pi's /boot/config.txt ? Without it the kernel won't make the SPI driver available.
by IanH
Tue May 03, 2016 9:45 pm
Forum: Python
Topic: Help with a python code please thanks
Replies: 2
Views: 688

Re: Help with a python code please thanks

You'll need to get rid of the </strong> closing tags as well.
by IanH
Fri Mar 18, 2016 4:56 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RS232 to USB serial communication
Replies: 13
Views: 17785

Re: RS232 to USB serial communication

So your ser.write() call will tell you how many characters it transmitted, but not whether anything was received. For the 'paperclip test' I'd suggest using a terminal emulator (minicom, GNU screen, etc), rather than the Python command-line. Personally, I've never had much luck with cheap USB-to-ser...
by IanH
Fri Mar 18, 2016 9:10 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RS232 to USB serial communication
Replies: 13
Views: 17785

Re: RS232 to USB serial communication

A very simple way to check if your RS232 connection is working is to 'loop back' the transmit line (TxD) to the receive line (RxD), so that characters you type in minicom (etc) are immediately echoed back to you. RxD and TxD are pins 2 and 3 on the DB-9 connector, so with a bit of practice you can j...
by IanH
Fri Mar 18, 2016 8:55 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: unable to detect pt2314 i2c device
Replies: 12
Views: 2697

Re: unable to detect pt2314 i2c device

It's possible that the PT2314 is working properly, but that i2cdetect fails to find it. The program works by trying some 'standard' I2C bus commands (typically 'register read' or 'register write') and seeing whether they work. At its lowest level, I2C just has 'send some bytes' and 'receive some byt...
by IanH
Wed Mar 09, 2016 9:03 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Can I protect my pi from frying with resistors
Replies: 18
Views: 2740

Re: Can I protect my pi from frying with resistors

A while back I wrote a page at http://www.elinux.org/RPi_GPIO_Interface_Circuits which gives very simple circuits for connecting inputs and outputs to a Pi's GPIO pins - this includes using a transistor to switch a bigger load on and off.

If anything's not clear, please let me know.
Cheers
Ian
by IanH
Fri Mar 04, 2016 2:30 pm
Forum: Python
Topic: spidev 74HC597 74HC595 problem
Replies: 7
Views: 1757

Re: spidev 74HC597 74HC595 problem

I think you have pin 13 (PL#) wired permanently low, which means the shift register won't ever shift, and the Q output will always follow the D7 input. There's a timing diagram on p5 of NXP's datasheet (http://www.nxp.com/documents/data_sheet/74HC_HCT597.pdf) which probably shows this better. To cap...
by IanH
Fri Mar 04, 2016 12:56 pm
Forum: Troubleshooting
Topic: My RPi 3 Gives wrong Info or Not?
Replies: 9
Views: 14329

Re: My RPi 3 Gives wrong Info or Not?

I was just reporting that I got half the BogoMIPS that @RaTTuS had, which seems a little odd. Using lscpu I get a likely looking: Architecture: armv7l Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 Model name: ARMv7 Processor rev...
by IanH
Fri Mar 04, 2016 11:17 am
Forum: Troubleshooting
Topic: My RPi 3 Gives wrong Info or Not?
Replies: 9
Views: 14329

Re: My RPi 3 Gives wrong Info or Not?

I've just dd'd 2016-02-09-raspbian-jessie-lite.img onto a MicroSD, and my Pi 3 gives: [email protected]:~ $ cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 4 (v7l) BogoMIPS : 38.40 Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 CPU im...
by IanH
Wed Mar 02, 2016 10:06 am
Forum: General discussion
Topic: Bluetooth 4.0 (LE, low energy)
Replies: 33
Views: 45315

Re: Bluetooth 4.0 (LE, low energy)

To answer the OP, the dongles I've tested bluepy with are listed at http://www.elinux.org/RPi_Bluetooth_LE#Hardware Currently, these are a Plugable adapter using a Broadcom BCM20702, and a CSR based one. I've got a Pi 3 on its way, so I'll let you know how its built-in adapter (I'm assuming it's Bro...
by IanH
Wed Mar 02, 2016 9:58 am
Forum: Off topic discussion
Topic: Need help to get started with C2650 sensor tag
Replies: 4
Views: 2122

Re: Need help to get started with C2650 sensor tag

Just FYI, the CC2650 code is now integrated into the main sensortag.py file in Bluepy.

Source and README are at https://github.com/IanHarvey/bluepy, and it's now available as a package on PyPI (https://pypi.python.org/pypi/bluepy).

Cheers
IH
by IanH
Tue Feb 23, 2016 8:59 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Adding an ENC28J60 Ethernet module - instructions
Replies: 14
Views: 5663

Adding an ENC28J60 Ethernet module - instructions

Hi folks, I've written up some instructions for adding an ENC28J60 Ethernet interface to any Pi. The project is at: http://www.instructables.com/id/Super-Cheap-Ethernet-for-the-Raspberry-Pi/ Hopefully this is simple enough for a school project, or something to do with your kids. I know it's only a 1...
by IanH
Sun Feb 21, 2016 10:54 pm
Forum: HATs and other add-ons
Topic: B+ "no longer manufactured" ?
Replies: 5
Views: 1961

B+ "no longer manufactured" ?

I've just been to CPC's website (cpc.farnell.com) looking for the Model B+ (single-core version, not the Pi 2), and it says "no longer manufactured"...
Pi B+.png
Pi B+.png (47.75 KiB) Viewed 1961 times
Is the website having a funny 5 minutes, or did I miss an announcement somewhere?
by IanH
Fri Jul 03, 2015 9:40 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: New GPIO pinout diagram on elinux.org
Replies: 3
Views: 632

Re: New GPIO pinout diagram on elinux.org

Thanks for the comments. The page has now been updated & I've also put some photos of the A+ / B+ boards on for orientation.

I felt the code samples were getting rather lengthy, so they're now on a new page: http://elinux.org/RPi_GPIO_Code_Samples

Cheers
IH
by IanH
Wed Jul 01, 2015 7:52 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: New GPIO pinout diagram on elinux.org
Replies: 3
Views: 632

New GPIO pinout diagram on elinux.org

I've updated the page at http://elinux.org/RPi_Low-level_peripherals to include a new diagram showing the 40-pin GPIO connector pinout. I'd be grateful if eagle-eyed GPIO experts could check it for accuracy, particularly as this page is linked from the official Pi documentation at https://www.raspbe...
by IanH
Wed Jun 03, 2015 7:55 am
Forum: General discussion
Topic: Forum search doesn't like "kernel"
Replies: 8
Views: 1106

Re: Forum search doesn't like "kernel"

So there's no good excuse for this particular behaviour, because (a) surely it's configurable - there must be a file with 'ignored' search terms which can be hacked, somewhere, and (b) Other Search Engines Are Available. Lots of sites actually embed Google (etc.) search into the front page (Google C...
by IanH
Tue Jun 02, 2015 6:50 pm
Forum: General discussion
Topic: Forum search doesn't like "kernel"
Replies: 8
Views: 1106

Forum search doesn't like "kernel"

Can somebody please fix the search feature on the forum so that it doesn't ignore "kernel" as a search term? I'm trying to search for 'kernel headers', but all I get are results for 'headers', all 2355 of them, most of them referring to headers of the 0.1" variety. How can throwing away one of the t...
by IanH
Thu Sep 18, 2014 7:45 am
Forum: Python
Topic: Export data information to html page
Replies: 6
Views: 2024

Re: Export data information to html page

You could try the Python 'requests' library (http://docs.python-requests.org/en/latest/) which will let a program make HTTP requests from a web server and process the results.
by IanH
Fri Sep 05, 2014 7:09 am
Forum: Python
Topic: Import a python script into another one
Replies: 5
Views: 4056

Re: Import a python script into another one

There's a small amount of magic you need to be aware of: when you import a Python file, all the code at the 'top level' gets run. So, if you import robot2.py in its current form into another script, it will try to run the Tk code at the bottom of the file which will loop waiting for a keypress. To s...
by IanH
Thu Aug 14, 2014 5:25 pm
Forum: Beginners
Topic: power with PoE
Replies: 11
Views: 2250

Re: power with PoE

It works fine with 100Mb/s - the 100Base-TX standard only uses two pairs of wires, one for transmit and one for receive. You can see this on the Pi schematic.

It won't work with Gigabit Ethernet, but then neither does the Pi or Beagleboard.

Cheers
Ian
by IanH
Sun Jun 22, 2014 4:40 pm
Forum: C/C++
Topic: for(c=10; c >= 0; c--) question
Replies: 10
Views: 2723

Re: for(c=10; c >= 0; c--) question

A reasonably common idiom is:

Code: Select all

unsigned int i = some_iteration_count();

while ( i-- > 0 )
{
  do_stuff();
}
Obviously this is only correct if some_iteration_count() returns 0 or a positive number.
by IanH
Sun Jun 22, 2014 4:35 pm
Forum: Python
Topic: Remove and Also Loop
Replies: 6
Views: 1444

Re: Remove and Also Loop

Cut out this line at the top: now = datetime.now() and paste it into weddingtime() itself, viz: def weddingtime(): now = datetime.now() wedding = "%d days, %d hours,\n%d minutes" % daysHoursMinutesSecondsFromSeconds(dateDiffInSeconds(now, leaving_date)) lcd.message (wedding) sleep(1) lcd.clear Make ...
by IanH
Tue May 27, 2014 6:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Programming Arduino without USB
Replies: 7
Views: 4554

Re: Programming Arduino without USB

One more question, if I need to rescue the Arduino, how to wire and use SPI to ICSP it? Are you making a board of your own using an ATMega328 chip? If so, I'd recommend getting a Uno R3, and using it as a programming board - the '328 is socketed, and you can swap chips in and out to program them. I...

Go to advanced search