Author Topic: AR488 Arduino-based GPIB adapter  (Read 269112 times)

0 Members and 5 Guests are viewing this topic.

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #350 on: February 06, 2020, 08:11:59 pm »
P.S.

I attach the simple code that does connect to my home IP for reference.

Also:
The simple code never shows an upload error, neither with nor without debugging activated.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #351 on: February 07, 2020, 12:42:39 am »
Hi, I have just tried your new firmware version with the debug switches on.
Funny thing: As soon as I activated the debug switches, the upload errors disappeared.

Strange. It does change the compile options, but shouldn't make a difference as regards the success of the upload. Which board profile are you using? I upload using "Generic ESP8266 Module".

But I'm afraid still no connection to my home AP.
Also, I fear I cannot read anything from the debug log.
I attach it in hope that you may learn something from this.

Thanks for the log. I will have a look at it and analyse tomorrow.

Btw, my password is quite long. In fact it is longer than the input field. Is there a limit on the length of the password?
I assume, WPA2 should be no problem as the simple bridge code I initially used, did connect to my home AP.

If your password is longer than 19 characters that could indeed be the problem. The password length in my code is 20 characters (minus one for the NULL terminator). I see the bridge code handles things differently. Thanks for attaching that example BTW.

And just to be sure I do not make a stupid mistake:
I switch wifi mode to client.
I activate DHCP for automatic IP address assignment.
I enter the SSID of my home AP into the ESSID field.
I enter the password of my home IP into the Password field.
I hit the Apply button.
That's where the log starts.
The log ends, when the ESP falls back to AP mode.

Your process looks spot on.
« Last Edit: February 07, 2020, 11:51:25 am by WaveyDipole »
 

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #352 on: February 07, 2020, 06:21:16 am »
Quote
Which board profile are you using? I upload using "Generic ESP8266 Module".
This is what I use, too.

Quote
If your password is longer than 19 characters that could be the problem. The password length in my code is 20 characters (minus one for the NULL terminator).
Then, we have found the reason. My password is longer than the limit. Can this be changed? Are you short in non-volatile memory?

Best regards.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #353 on: February 07, 2020, 11:48:16 am »
In the bridge code you place your password between quotes in the code and it is assigned to a constant. The amount of memory required for the constant will be calculated and allocated at compile time. In this case however, the password is being captured from the web page and we don't know how long it is until it has been submitted so we allocate a sensible amount of space. I discovered that the maximum number of characters allowed for the SSID on the ESP8266 is 31. I suspect it will be the same for the password although I couldn't find anything to confirm that. I have therefore extended the limit to 31 characters.

Lets just say that non-volatile memory is not in abundance but there may be another way around this which I need to explore.

EDIT:
Attachment removed. Latest version here:
Latest version here: https://github.com/Twilight-Logic/AR488/tree/master/src/AR488-ESP8266-addon
« Last Edit: February 16, 2020, 09:41:15 pm by WaveyDipole »
 

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #354 on: February 07, 2020, 12:15:18 pm »
Many thanks, 31 will do for me. I will try to test tonight when back home.

Best regard.
 

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #355 on: February 07, 2020, 09:28:17 pm »
Success! The little beast is connected to my home network now.
Many thanks for the new version!

One find:
I did fire it up with DHCP activated and apparently, an IP address was automatically assigned.
When I then entered the wifi configuration tab via my home network, the DHCP switch was in off state again, but the gateway and netmask input fields were greyed out.

And after power cycling the ESP, it is back in AP mode. I believe you mentioned that this is still work in progress, right?

Best regards.

P.S.

I have just tested static IP without DCHP. This works nicely, too.  :-+
« Last Edit: February 08, 2020, 07:59:47 am by tom_iphi »
 
The following users thanked this post: WaveyDipole

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #356 on: February 08, 2020, 08:08:07 am »
Many thanks for the PCB links!

Quote
but if you want to modify it just ask me for the kicad sources

Yes, please. I want to add a second PCB stack for a wifi chip and I would like to avoid re-inventing board outlines and the connector footprints.
I'm glad you are using KiCAD, too. KiCAD files of ar488promicro would be highly appreciated. Thank you very much!

Best regards.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #357 on: February 08, 2020, 09:35:13 pm »
Success! The little beast is connected to my home network now.
Many thanks for the new version!

Thanks for the feedback. Seems we are making progress here and the password getting truncated was the problem.

One find:
I did fire it up with DHCP activated and apparently, an IP address was automatically assigned.
When I then entered the wifi configuration tab via my home network, the DHCP switch was in off state again, but the gateway and netmask input fields were greyed out.

Yes, sorry about that and it is a problem that I am aware of. When you submit the form, the config is passed to the WiFi server, but the submit action causes the WiFi config page to reload and it ends up reverting back to the default AP setup. Getting it to reflect the correct state of the WiFi controls is also one of the bits of work on my to-do list.

And after power cycling the ESP, it is back in AP mode. I believe you mentioned that this is still work in progress, right?

Yes, still very much a work in progress. Hoping to get al least some of the work mentioned above done this coming week.

I have just tested static IP without DCHP. This works nicely, too.  :-+

Again, thanks for the report.
 

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #358 on: February 13, 2020, 12:24:11 pm »
For the records:

I have solved the ESP8266 connectivity problem when hooked up to the AR488 adapter:
My LF33 3.3V voltage regulator was oscillating. The output blocking cap was broken, fixed now.
The problem had nothing to do with the ESP firmware, which works great.

And I have found a way to power the AR488+ESP8266 combo directly from my HP8593E spectrum analyzer.
It has an external keyboard PS2 socket, which provides 5V power.  :)
Best regards.
 
The following users thanked this post: coromonadalix, WaveyDipole

Offline grizewald

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: ua
Re: AR488 Arduino-based GPIB adapter
« Reply #359 on: February 16, 2020, 02:22:47 pm »
I wanted to get some logging going with my Solartron 7061 and this project looked like just the ticket.

I have a MEGA 2560 card running the code and it talks to both my 7150+ and 7061 meters when using it from a terminal emulator with no problem.

One thing I wanted to do, over and above logging a voltage over time was to add environmental data - as in temperature, humidity and pressure. I have a small device which measures these parameters and transmits the results every minute to a local MQTT broker so as to make the data available for different purposes.

So I wrote some shell script to set up the AR488 with the measurement parameters. Once the measurement is set up, I set ++auto 3 and do a ++read. Then I enter a loop which just reads the incoming results from the serial port. There is another bit of shell script running in the background which queries the MQTT server once every minute and writes the current temperature, humidity and pressure out to a file.

All the loop does is combine the data from the AR488 with the data from the MQTT server, creates a timestamp and appends the resulting line to a CSV file. So far so good.

The problem I'm experiencing with the 7061 is that after about 15 results have come in (each measurement takes 8 seconds), the 7061 suddenly displays "21 I/P BUFFER OVERFLOW" on the display and stops delivering results.

Has anyone any idea why this might happen? I'm not sending anything to the AR488 at this point, I'm just reading the auto-fetched measurements.
  Lord of Sealand
 

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #360 on: February 16, 2020, 02:46:42 pm »
Hi grizewald,
sounds like your meter is measuring faster than it gets rid of the data via GPIB.
Eventually, the internal buffer fills up and flows over.
It would be safer to trigger single measurements via GPIB when they are needed.
 

Offline grizewald

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: ua
Re: AR488 Arduino-based GPIB adapter
« Reply #361 on: February 16, 2020, 02:57:36 pm »
The error message was "I/P buffer overflow", so it was the input (I/P) buffer rather than the output buffer. However, I seem to have fixed the problem! At the start of the script, I set up the serial port with:

stty -F $PORT 115200 raw

The fix was to change that to:

stty -F $PORT 115200 raw -echo

Somehow, the incoming data was being echoed back to the output. Turning local echo off has stopped that and I've now logged over 150 readings and it's still running just fine.

I'm probably mad trying to handle serial I/O in shell script, but I thought it would be an interesting challenge. And it sure was!  :-DD
  Lord of Sealand
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3486
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #362 on: February 16, 2020, 03:55:38 pm »
When I had the USA Cal Club Round 2 kit, I wrote an awk script to read a temperature and humidity sensor attached to an Arduino, the system time and a pair of 34401As using AR488 to log data on a Linux box.

It was rather more messy than I liked, but it it was quick to implement.  It did have issues with latency.

Have fun!
Reg
 

Offline grizewald

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: ua
Re: AR488 Arduino-based GPIB adapter
« Reply #363 on: February 16, 2020, 04:35:24 pm »
It only took the weekend to get my script up and running. Most of that time went on battling with the fact that you can't let the serial port get closed as that resets the Arduino the next time the port is opened.

I ended up having the script start separate processes for reading and writing to the serial port. They use named pipes as their input or output to communicate with the main process. The code that handles reading environmental data from the MQTT broker is also created as a separate process and as my sensor only updates the broker once every minute, the reader sleeps for a minute between fetching the new values.

It's quite nice to be able to integrate the various data sources into one output file. I reckon doing it as a shell script was actually easier than writing C code to deal with a Linux serial port.
  Lord of Sealand
 

Offline grizewald

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: ua
Re: AR488 Arduino-based GPIB adapter
« Reply #364 on: February 16, 2020, 04:37:06 pm »
Now I just have to work out how to plot all that data!
  Lord of Sealand
 

Offline grizewald

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: ua
Re: AR488 Arduino-based GPIB adapter
« Reply #365 on: February 16, 2020, 06:45:09 pm »
I'd forgotten how much I liked gnuplot!

  Lord of Sealand
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #366 on: February 16, 2020, 09:34:23 pm »
For the records:

I have solved the ESP8266 connectivity problem when hooked up to the AR488 adapter:
My LF33 3.3V voltage regulator was oscillating. The output blocking cap was broken, fixed now.
The problem had nothing to do with the ESP firmware, which works great.

Again, thanks for the report.

And I have found a way to power the AR488+ESP8266 combo directly from my HP8593E spectrum analyzer.
It has an external keyboard PS2 socket, which provides 5V power.  :)
Best regards.

An interesting solution to provide power! A quick look suggests that the PS/2 port should be able to supply about 275mA, so enough to supply one Arduino and one ESP8266.

I have had a rough time with my health but still managed to do quite a bit of work on refining and testing the ESP8266 sketch. I have completed the configuration storage functions, fixed a couple of glitches with the status of controls and a few other bits. For now I am using EEPROM functions but was contemplating moving to using spiffs. One drawback is that it would require the user to perform additional steps to set up the IDE, but it would make it somewhat easier to maintain the code.

Steps still to be completed include SSL, authentication and review of functions on the Admin tab.

I have uploaded the current version to the AR488 Git here:
https://github.com/Twilight-Logic/AR488/tree/master/src/AR488-ESP8266-addon

It only took the weekend to get my script up and running. Most of that time went on battling with the fact that you can't let the serial port get closed as that resets the Arduino the next time the port is opened.

It is possible to prevent the reset as detailed here:
https://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection/

Also on the Mega2560 it is possible to use one of the other serial ports connected to one of those FT232RL modules.

Not seen GNUplot before. Will have to have a look at that. Thanks for the picture.
« Last Edit: February 16, 2020, 10:16:22 pm by WaveyDipole »
 

Offline grizewald

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: ua
Re: AR488 Arduino-based GPIB adapter
« Reply #367 on: February 17, 2020, 06:09:44 am »
It only took the weekend to get my script up and running. Most of that time went on battling with the fact that you can't let the serial port get closed as that resets the Arduino the next time the port is opened.

It is possible to prevent the reset as detailed here:
https://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection/

Also on the Mega2560 it is possible to use one of the other serial ports connected to one of those FT232RL modules.

Not seen GNUplot before. Will have to have a look at that. Thanks for the picture.

Thank you for the excellent project!

I hadn't actually looked at whether it was possible to disable the auto-reset function. Using a different serial port to talk to the Mega is a nice idea as well, but would mean more cables between the Mega and the computer of course.

Gnuplot is super simple and very flexible. My script produces a log which looks like this:

Code: [Select]
2020-02-16 15:35:38,24.17,40.30,983.74,+1.0183911
2020-02-16 15:35:46,24.17,40.30,983.74,+1.0183908
2020-02-16 15:35:54,24.17,40.30,983.74,+1.0183906
2020-02-16 15:36:02,24.17,40.30,983.74,+1.0183907
2020-02-16 15:36:10,24.17,40.30,983.74,+1.0183908
2020-02-16 15:36:18,24.17,40.30,983.74,+1.0183909
2020-02-16 15:36:26,24.17,40.30,983.74,+1.0183906

Date/time, temperature, humidity, pressure, voltage

The gnuplot file which creates the graph is as simple as:

Code: [Select]
set lmargin screen 0.2
set datafile separator ","
set terminal png size 1800,800
set multiplot
set title "7061 Weston Cell Readings"
set xlabel "Time"
set xdata time
set timefmt "%Y-%m-%d %H:%M:%S"
set format x "%H:%M"
set key off
set grid
set ylabel "Temperature" offset 7,0 textcolor rgb "red"
set format y "%10.1f"
plot "WestonLog.csv" using 1:2 with lines lw 2 lt rgb "red"
set ytics offset -8,0
set ylabel "Humidity" offset -1,0 textcolor rgb "green"
set format y "%10.1f"
plot "WestonLog.csv" using 1:3 with lines lw 2 lt rgb "green"
set ytics offset -16, 0
set format y "%5.1f"
set ylabel "Pressure" offset -14,0 textcolor rgb "blue"
plot "WestonLog.csv" using 1:4 with lines lw 2 lt rgb "blue"
set ytics offset -24, 0
set format y "%10.7f"
set ylabel "Voltage" offset -21,0 textcolor rgb "violet"
plot "WestonLog.csv" using 1:5 with lines lw 2 lt rgb "violet"
unset multiplot

It's also very fast. My log has now grown to 6,500 lines and it takes only 0.1 seconds to produce the graph on my old Thinkpad X220 laptop.
  Lord of Sealand
 
The following users thanked this post: coromonadalix

Offline tom_iphi

  • Regular Contributor
  • *
  • Posts: 72
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #368 on: February 17, 2020, 03:36:30 pm »
Quote
I have uploaded the current version to the AR488 Git here:
https://github.com/Twilight-Logic/AR488/tree/master/src/AR488-ESP8266-addon

Many thanks for the new version. I have just tested it and it works great. Now, the system is really usable as the wifi settings are being memorized. :)

Quote
For now I am using EEPROM functions but was contemplating moving to using spiffs.

As said I am completely happy with the firmware as is, but if you decide to move to spiffs, I will happily test.

Thanks again for your great work!
Best regards.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #369 on: March 06, 2020, 10:13:25 pm »
So I've gotten this firmware working nicely to dump plots from my 8594E into the 7470A plotter emulator, it works beautifully with no problems at all.

Then I tried with a TDS410A scope just for fun and spent quite some time banging my head against the wall. This scope does not appear to support requesting plots from the instrument the way the 8594E does, and pressing Hardcopy on the scope just sits there waiting, until that is I send a ++read command, then it will happily start dumping data. Somebody in another thread happened to do something very similar in parallel and noted that the read command on the PC side asserts one or more lines on the bus and that causes the scope to start printing. Is this something that can be fixed in the arduino firmware or would it require changes to the plotter emulator? The TDS400 series scopes have to be set to talk-only in order to use the GPIB port for hardcopy. Once you get it to start sending the data, the 7470A emulator can receive and render it without difficulty.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2010
  • Country: dk
Re: AR488 Arduino-based GPIB adapter
« Reply #370 on: March 07, 2020, 09:26:40 am »
So I've gotten this firmware working nicely to dump plots from my 8594E into the 7470A plotter emulator, it works beautifully with no problems at all.

Care to share the 8594E script & settings ?

/Bingo
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #371 on: March 07, 2020, 11:11:57 pm »
Care to share the 8594E script & settings ?

/Bingo


There is no script or settings per se, I simply loaded up the 7470A program and selected "Request plot from supported device at address 14". The 8594E is set to talk/listen on address 14 and when I select that it triggers a capture and renders it in the emulator program, simple as that.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #372 on: March 08, 2020, 05:05:14 am »
After someone else mentioned it, I'm wondering if the not yet implemented ++lon command is the issue here. According to documentation I found that's "Listen Only" which certainly sounds like what I need.

*edit: So I looked in the code and realized that ++lon is implemented, I don't know why I had it in my head that it was not. I played around with the 7470A plotter emulator and found that if I select request plot from device then it will assert NDAC and then the scope will start sending the plot however the emulator then interprets that data as the instrument name. If I put the plotter emulator in listen mode then NDAC never asserts and the scope never sends the data.

I have not yet tried to intercept the serial data and see what commands are being sent to the interface.
« Last Edit: March 08, 2020, 06:25:12 am by james_s »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #373 on: March 11, 2020, 01:34:38 pm »
*edit: So I looked in the code and realized that ++lon is implemented, I don't know why I had it in my head that it was not.

The ++lon command was not implemented when the firmware was first released but was eventually added to firmware version 0.47.51.

I played around with the 7470A plotter emulator and found that if I select request plot from device then it will assert NDAC and then the scope will start sending the plot however the emulator then interprets that data as the instrument name.

I don't have any experience with the TDS410, but looking at the Programmer manual that I found at the link below, I wonder whether the HARDCopy:FORMat command would allow setting a format that the 7470A plotter emulator will understand? (HARDCopy:HPGl perhaps?)

http://w140.com/tekwiki/wiki/TDS410
« Last Edit: March 11, 2020, 01:36:26 pm by WaveyDipole »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: AR488 Arduino-based GPIB adapter
« Reply #374 on: March 11, 2020, 04:09:28 pm »
The hardcopy format is correct, the scope sends HPGL and the plotter emulator renders it just fine. The problem is that the line that tells the scope to start sending does not assert when the plotter emulator is set to listen on all addresses. The TDS400 series only support hardcopy in talk-only mode and do not address a plotter at a specific address.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf