Go to advanced search

by rkn704
Fri Nov 20, 2020 6:25 pm
Forum: Python
Topic: Send Hex data from txt file over serial link.
Replies: 3
Views: 186

Re: Send Hex data from txt file over serial link.

Thank you for the suggestions scotty101 and SurferTim. What I managed to get working was this for data in savedlogfile: for item in data.split(','): ser1.write((item[2:4]).decode("hex")) The data in my txt file was hex data for Ascii characters in a single large string and it looked like 0x0E,0x1B,0...
by rkn704
Fri Nov 20, 2020 12:37 pm
Forum: Python
Topic: Send Hex data from txt file over serial link.
Replies: 3
Views: 186

Send Hex data from txt file over serial link.

I would like to send test Hex data via a serial connection to another Pi that will have a monitoring program. I have a txt file with the data in it but I need a way to be able to send it. I believe the code below will send Hex data from an array?. Do I need to create an array from my txt file, if so...
by rkn704
Thu Nov 12, 2020 5:18 pm
Forum: Beginners
Topic: ADDS Viewpoint Terminal Emulator for Raspberry Pi?
Replies: 0
Views: 48

ADDS Viewpoint Terminal Emulator for Raspberry Pi?

Is there a terminal emulator available for the Pi that can emulate the ADDS Viewpoint(+) range of terminals. I know there are various emulators around for Windows and Linux systems but I am looking for a free one. Or if you can point me at the character/control coding for these terminals so I can ma...
by rkn704
Thu May 21, 2020 6:00 pm
Forum: Python
Topic: How to test encoder with raspberry Pi
Replies: 33
Views: 3238

Re: How to test encoder with raspberry Pi

sorry problem with uploading the image. Try the link below

http://www.pentagon-electronics.co.uk/richdiag.pdf
by rkn704
Thu May 21, 2020 5:58 pm
Forum: Python
Topic: How to test encoder with raspberry Pi
Replies: 33
Views: 3238

Re: How to test encoder with raspberry Pi

I have worked with other encoders with similar notation on them. The outputs on the ones I have used have a differential type output so the voltage swings positive and negative as you turn the shaft. In the diagram below when the output is positive the opto-coupler passes the signal to the Pi. When ...
by rkn704
Fri Mar 06, 2020 4:09 pm
Forum: Python
Topic: How to detect mobile phone (cell phone) MAC address and IP address.
Replies: 5
Views: 464

Re: How to detect mobile phone (cell phone) MAC address and IP address.

I think the issue may be related to the time it takes the phone to reply. When I ping the other PC's etc I get ping values of 3 - 10ms. When I ping my phone, I get values consistently in the range 200-340ms. How long does Nmap wait before stepping on to the next IP address. I have tried the -T2 and ...
by rkn704
Fri Mar 06, 2020 2:14 pm
Forum: Python
Topic: How to detect mobile phone (cell phone) MAC address and IP address.
Replies: 5
Views: 464

Re: How to detect mobile phone (cell phone) MAC address and IP address.

Thank you for the prompt reply. I tried your sudo nmap -sP -PI -PT 192.168.1.1/24 but my android HTC phone is still not listed. I can see other equipment OK but not my phone. I can ping it and it always replies. I know its IP address from a very useful phone app "Network IP Scanner" Any other ideas?...
by rkn704
Fri Mar 06, 2020 11:24 am
Forum: Python
Topic: How to detect mobile phone (cell phone) MAC address and IP address.
Replies: 5
Views: 464

How to detect mobile phone (cell phone) MAC address and IP address.

I want to regularly record and keep a history of all MAC address and IP address details for items connected to our router at home to help resolve an IP clash issue that occasionally occurs. I have tried using Nmap with the -sn option to discover the Hosts but have noticed that some connected equipme...
by rkn704
Fri Oct 25, 2019 11:19 am
Forum: Python
Topic: [solved] Puzzled by two simple hex-dec-string mixup
Replies: 7
Views: 1974

Re: Puzzled by two a simple hex-dec-string mixup

I use the binascii module for converting serial data to Hex or Ascii representation. The following has been chopped from a program that monitors a serial port and then saves the data to two separate text files. One with the Hex data the other with the Ascii. You can easily manipulate the data once i...
by rkn704
Thu May 09, 2019 12:22 pm
Forum: Français
Topic: Controle Moteur avec une carte Sabertooth 2x12
Replies: 4
Views: 565

Re: Controle Moteur avec une carte Sabertooth 2x12

I am sorry I can't reply in French. I had a look at the Sabertooth I think your switch settings need checking if you want to use pwm. Using the selections shown on https://www.dimensionengineering.com/datasheets/SabertoothDIPWizard/start.htm Step 1 Lipo or NiCd & Lead Acid? You choose Lipo? Step 2 F...
by rkn704
Thu Apr 25, 2019 12:50 pm
Forum: Python
Topic: TwythonStreamer and CUPS printer
Replies: 3
Views: 330

Re: TwythonStreamer and CUPS printer

You can also use the lp command check out https://www.computerhope.com/unix/ulp.htm this is a simpler method.

I used the cups.Connect type method as shown in my previous post as I needed to detect when different printers of the same printer model were connected by reading the URI info .
by rkn704
Thu Apr 25, 2019 12:27 pm
Forum: Python
Topic: TwythonStreamer and CUPS printer
Replies: 3
Views: 330

Re: TwythonStreamer and CUPS printer

This is how I send txt files to a Cups printer for printing. Make sure your Cups server has been running for 10 seconds or so before attempting to use the cups.Connection method. I got caught out with printing not working after rebooting the Pi until I put in a delay to allow the Cups server to get ...
by rkn704
Sun Mar 24, 2019 12:06 pm
Forum: Advanced users
Topic: modbus rtu arduino raspberry over usb
Replies: 2
Views: 2268

Re: modbus rtu arduino raspberry over usb

I tried to use the ttyACM port and a USB cable between the PI and Arduino but was receiving an error 'object has no attribute 'registers' I eventually figured out that this problem is caused by the initial port setup causing the Arduino to reset. (My Arduino is a Elegoo Uno R3, not sure if this beha...
by rkn704
Sun Mar 24, 2019 10:29 am
Forum: Troubleshooting
Topic: send to /dev/ttyACM0
Replies: 2
Views: 4848

Re: send to /dev/ttyACM0 with Arduino

This may be an old post but I think this may help others. I had the same issues as AndreeeCZ until I realised that when the ttyACM port is initially setup it causes the Arduino to reset. This means that for the next 1 seconds or so the Arduino is ignoring data you may be sending to it. If the code i...
by rkn704
Sun Feb 17, 2019 2:02 pm
Forum: Python
Topic: Modbus RTU RasPi 3B+ and PowerMeter
Replies: 2
Views: 1163

Re: Modbus RTU RasPi 3B+ and PowerMeter

Did either of you guys manage to overcome this issue with Pymodbus. I am seeing the same problem when trying to replicate the tests shown in this post https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=233458&sid=7724b72a2151954c4eb71d63ac409bc6 Like Mopsiu50 I have tried to use an Arduino as a...
by rkn704
Thu Feb 14, 2019 10:24 am
Forum: Advanced users
Topic: modbus rtu arduino raspberry over usb
Replies: 2
Views: 2268

Re: modbus rtu arduino raspberry over usb

I haven't tried this before but after looking at Modbus basics on Wiki I am wondering if the PI part value = client.read_input_registers(10000,1,unit=1) should it read ? value = client.read_input_registers(10001,2,unit=1) 10001 for the start register 2 for the function code to read inputs (or possib...
by rkn704
Sat Dec 08, 2018 10:50 am
Forum: Python
Topic: program stops at random
Replies: 8
Views: 1036

Re: program stops at random

Did you resolve this issue? I left your program running on a Pi using Putty to SSH to it. It ran fine for 48+ hours. I would disconnect the LED's and any external hardware and see if the program runs OK. How are you powering the LED's? Try a different power supply. I had all sorts of problem when us...
by rkn704
Tue Dec 04, 2018 4:36 pm
Forum: Python
Topic: sensor dht11 + lcd + log csv
Replies: 7
Views: 1296

Re: sensor dht11 + lcd + log csv

I posted a logging type reply the other day see

viewtopic.php?f=32&t=227957

For your application write the data with commas separating the the values and change the file extension to CSV instead of TXT
by rkn704
Mon Dec 03, 2018 6:07 pm
Forum: Python
Topic: Outputting text to a .txt file one a micro controller 3
Replies: 3
Views: 1029

Re: Outputting text to a .txt file one a micro controller 3

How about something like this to get you started #!/usr/bin/env python import time import datetime now = datetime.datetime.now() truncnow = str(now)[0:19] fileName = "My_test_"+ truncnow + ".txt" #file name with date & time f = open(fileName,'w') #creates file f.write("Here is my test file" + "\n") ...
by rkn704
Mon Nov 19, 2018 10:01 am
Forum: Python
Topic: GPIO output is sensed by another GPIO input...
Replies: 3
Views: 910

Re: GPIO output is sensed by another GPIO input...

I would start by concentrating on the electronics. Any relay with a coil should have a 'flywheel' (flyback) diode fitted across it. If you have purchased a relay board there should be diodes fitted or the IC driving the coils should have an in built diodes. Without a diode there will be a huge spike...
by rkn704
Sun Aug 05, 2018 12:47 pm
Forum: Python
Topic: Serial problem
Replies: 10
Views: 1045

Re: Serial problem

With the rtscts = True you have to have your receiving device returning the correct handshake signal before you can send out data. You say you are monitoring the output with a scope. As the scope will possibly not have handshaking I think you should remove all handshaking features. Remove the follow...
by rkn704
Tue Jul 03, 2018 1:44 pm
Forum: Python
Topic: [SOLVED] Python - Sainsoft USB 4 Relay Board
Replies: 14
Views: 3532

Re: Python - Sainsoft USB 4 Relay Board

Going back a couple of steps. I believe the problem when you tried using the sample code that numato posted on git hub was in the section #Send the command serPort.write("relay "+ str(relayCmd) +" "+ str(relayNum) + "\n\r") I think it should be #Send the command serPort.write("relay write "+ str(rel...
by rkn704
Mon Jun 11, 2018 12:30 pm
Forum: Python
Topic: Serial error when adding script the pi startup
Replies: 3
Views: 601

Re: Serial error when adding script the pi startup

I had an issue with serial comms following auto start up. To overcome the issue I just put a small delay in at the beginning of the program so that all services could settle down before comms became active. It only runs once at the startup so it should not be a problem. Ten seconds made all the diff...
by rkn704
Wed May 09, 2018 12:53 pm
Forum: Python
Topic: space code python
Replies: 3
Views: 548

Re: space code python

I think you will need to close the file so you can view the results. f.close() Where I have text files that I want to monitor I open the file for writing, write the data and then immediately close the file so I can then view the captured data at any time. yourdata below needs to be a string f.write(...
by rkn704
Wed Apr 11, 2018 1:35 pm
Forum: Python
Topic: Need help using serial port - RPi 3 Model B
Replies: 8
Views: 4241

Re: Need help using serial port - RPi 3 Model B +

Just tried your loopback test with a RS232 to USB converter and it worked fine (after sorting the indent for the try/except) If you use a RS232 to USB converter the port needs to be "/dev/ttyUSB0" or similar appropriate for the USB port you are using. Are you sure you do not have a hardware problem?...

Go to advanced search