Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 18
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
11/29 Sonic (58)
11/29 kamelryttarn (46)
11/30 arnsfelt (45)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Computer Science
Next topic »   

Build an IoT DMM, hardware engineer with smattering of software seeks software engineer ...

1 2 
Move Thread LAN_403
Dr. Slack
Fri Jul 06 2018, 02:30PM Print
Dr. Slack Registered Member #72 Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
... with some vague interest in hardware.

I play around with software, reasonably competent with python and microcontroller C, but have never really reached critical mass on things like linux, git, sockets, I2C. While I can search around for how to do any one thing, it's all a bit of a struggle. I'm aware that trying to invent too many things at once is likely to founder. So I regard my idea for a wifi enabled meter a bit too big for me to do on my own.

The general idea is this. Control and wifi done by something like Onion Omega 2+ (other micros are available). I've got options for the front end more or less sketched out in my mind. Two channels of voltage from 100mV to 1000V, three current channels (electronic switched pA to 1A or 10A, socket selected 1A to 10s or 100s of A, and a low accuracy log reading nA to A for wide instantaneous dynamic range, 2T/4T resistance, temperature, and maybe a few relay outputs for controlling battery test loads. What I need is a web interface that can be operated from a browser, and an API that a program can talk to.

This is just for fun. I'm not anticipating trying to sell it. That would involve timescales, specifications, funding, responding to competition. I'm retired, I don't need all that.

Anybody want to play?
Back to top
Sulaiman
Fri Jul 06 2018, 07:02PM
Sulaiman Registered Member #162 Joined: Mon Feb 13 2006, 10:25AM
Location: United Kingdom
Posts: 3140
Assuming that you are more into the software than the hardware;

You are aware of cheap usb or RS232 interface digital multimeters via eBay ?

I lost my £9.99 Maplin dmm w/RS232 but it was really useful for stuff like battery charge/discharge etc.

USB oscilloscopes with software are also available for faster stuff,

USB VNA and SDR cover the upper frequencies.

That would leave you just with the WiFi:USB to make/buy.

Back to top
Dr. Slack
Sat Jul 07 2018, 04:59AM
Dr. Slack Registered Member #72 Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
Sulaiman wrote ...

Assuming that you are more into the software than the hardware;

Perhaps I'm mistaken, but I thought I'd spelled out that my software was smattering, and I was more au fait with the hardware end?

wrote ...

You are aware of cheap usb or RS232 interface digital multimeters via eBay ?

Yeah, got one of those. I also use an Arduino as a crude USB connected multichannel voltmeter for battery charge/discharge monitoring, it's how I got the 'AA shoot-out' results Link2 of a while ago. My 4 channel Rigol will go fairly slow for monitoring tasks as well.

Am I correct that you're saying that you're not the man for the job?
Back to top
Shrad
Mon Jul 09 2018, 06:48AM
Shrad Registered Member #3215 Joined: Sun Sept 19 2010, 08:42PM
Location:
Posts: 780
I'd use a ESP8266 or ESP32 as it covers the complete range of your requirements, plus it can host the web interface without any hassle... and it is covered by arduino IDE and libraries for what I know
Back to top
Sulaiman
Mon Jul 09 2018, 08:34AM
Sulaiman Registered Member #162 Joined: Mon Feb 13 2006, 10:25AM
Location: United Kingdom
Posts: 3140
Dr. Slack wrote ...

Am I correct that you're saying that you're not the man for the job ?

Based on my ability to appreciate the question,
I gues the answer has to be ... YES
You have the wrong guy :(
Back to top
Plasma
Sun Jul 15 2018, 11:28PM
Plasma Registered Member #61406 Joined: Thu Jan 05 2017, 11:31PM
Location:
Posts: 268
I might be able to help, couple of questions
do you want a Web server thing to accept Get and Post requests or just socket sending hex across the wire, do you need dns and tcp/ip stack made or is Linux taken care of that.
Got a couple of projects on but one computer so don't want to set up Linux, using Windows, so any code want be tested.
Can you post the code you're done, would be easier going from there
Back to top
Dr. Slack
Mon Jul 16 2018, 06:18AM
Dr. Slack Registered Member #72 Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
Get and Post. I've often seen those referred to as I google around. I don't know the difference, and what using either would do for me. What should I want?

As far as I can tell, you ask for UDP or TCP at socket setup time. Though my minimalist nature leans me towards UDP, TCP would probably be better, and closer in spirit to what serial I/O does. I do want something that doesn't hang, or is easy to detect and reset hanging behaviour, should ends get unsynced due to a disturbance on the LAN, program bug, or whatever.

The device should sit on my local wifi network, so having an address of 192.168.1.x, accessible to everybody on my LAN, just like my printer or ADSL, and not visible to the world the WAN side of my ADSL. That suggests I don't need dns.

I want two modes of behaviour. Whether that needs two interfaces writing for the device I don't know, it may be easy enough to handle both behaviours through just one. It's all low speed, so there's a lot of scope for doing things inefficiently.

Mode 1

When I set up my ADSL, it has a web page I visit, that I can fill in and read values. I'd like to be able to do something like that, using a browser as a very manual method of driving, for initial setup, debugging etc, zero programming at the client end. I tell it to change the range of a channel, read a voltage, no more. The web page would essentially be a soft front panel into the device hardware. Once the web magic gets as far as running a program, preferably python but C would do, that presents one button and one entry box on a web page, I know where I am and can do the rest.

Mode 2

When I plug an Arduino into my USB, I can program it to work over serial I/O, and write a python program on my PC to talk to it, that works fine. I understand essentially the same thing can be done over sockets to a device on the LAN. That's the mode I'd want to use for running it automatically from a custom python program. I'd write my battery charger/tester or whatever else in python, and use the device as a fairly dumb peripheral, just as I've written a battery tester to use hardware hanging off my Arduino board.

If it's possible to fake this mode from the first, and I suspect it is, by using the host PC python program to construct web requests, then maybe I only need mode 1 on the device. However, I suspect mode 2 is an order of magnitude easier to implement, at least on the device.

I've looked at python socket tutorials and been left confused. I've read around peoples' experiences putting such things together, and found things like 'it will work on loopback but won't work over my LAN', which have inhibited me from mustering enough effort to put something together and try. I have not yet reached sufficient a critical mass of knowledge and warm fuzzy feeling to start along the path of trying things out. I do not yet know what a good tutorial looks like, a pointer at a good one might be sufficient. I always have this difficulty starting with new things, don't understand until I've got my hands dirty, can't bring myself to get my hands dirty until I've got some basic level of understanding of what I should canonically be doing.

The path would probably be something like this.
1) Write a simple server that can be set, read, and generate new information, like a clock, running on the same machine as a client to talk to it over loopback, both ends in python. Implement both modes.
2) Move the server to a different machine on the LAN, initially a laptop and then an RPi over RJ45 for instance.
3) Get an Onion Omega or similar, and repeat over wifi.

Software side 'hello world' achieved, I should be able to take it from there.

I only have linux Mint on my machines, but I can ask my son, who has python on his win10 laptop, to try odd things out from time to time if necessary. I do use wine for things like LTSpice, but don't want to introduce yet another potentially buggy interface into a process that I'm already struggling with. I had rather hoped that working over LAN would be fairly platform independent, with python to take care of any differences.
Back to top
Shrad
Mon Jul 16 2018, 10:34AM
Shrad Registered Member #3215 Joined: Sun Sept 19 2010, 08:42PM
Location:
Posts: 780
try this kind of implementation : Link2

easy, fast, repeatable
Back to top
Plasma
Mon Jul 16 2018, 11:25AM
Plasma Registered Member #61406 Joined: Thu Jan 05 2017, 11:31PM
Location:
Posts: 268
If a client sends a Get request, the values get added to the Url, if it is post it is values in the page.
I would probably get a client to send a request to the server, something like 192.168.2.2,you server on Linux sends a packet /string array back to the client using write socket with \ r\n \r \n as the last four bytes, you can then use a Web browser on the client, the string array is just copy paste of a Web page.
The Web pages has box's to enter data, HTML and JavaScript with a sibmit button that sends a Get request to 192.168.2.2/index.html/volts=200mV,display=1sec the sever code receives data of GET index. Html/volts, you use string functions to parse the read socket looking for volts= you then send that value to the hardware.

On Mint download or install "wireshark" it's a network packet anylser it will show you what a request from a Web browser looks like.

Sorry hope it helps
Back to top
Dr. Slack
Fri Jul 20 2018, 10:12AM
Dr. Slack Registered Member #72 Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
@PLasma Let's see if I can start hauling myself out of the swamp.

I've located the python http library, which will serve files like the default index.html when you access the base site. I'm trying to understand when the choice between making a get or post request is made? Is it the case that the html in that page has javascript in it which constructs either a get or post request when the client at his browser hits a button or makes some other triggering action? The server library has functions like do_get() and do_post() which I would imagine get called at the obvious times?
Back to top
1 2 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.