Is this the most astounding omission in LO usage?

I’m talking about tutorials / discussions / support and development of Serial port communication in LibreOffice Calc.
Yes there are commercial programs available to facilitate this but it seems to completely go against the grain of LO - which if I’m not mistaen leans heavily towards FOSS. (Free & Open Source Software).

There are stacks of MS / Office ways of reading serial data through the serial port which I have successfully managed to do by various ways, but I’m switching to Linux and LO because I want to get away from propriety software as I have zero faith that it isn’t spying on me in some way, or taking control over my computer in ways I simply don’t want.
I have been trying to read up and learn how to get data through the “serial (RS232, COM) port” into Calc using embedded scripts - either Calc BASIC or Calc python script/macros. It’s proved far too difficult for me - an amateur hobbyist programmer.
I have searched far and wide for information that reads the serial port but nothing I have ever come across ever works.
I am frankly astonished that something so useful isn’t published in a torrent of tutorials.

LO is so powerful and Its obvious that it can be programmed to do this, but I am forced to remain with Microsoft Windows and Office because of lack of info as to how to do data logging with Calc in a modern version of LO.

PLEASE can this problem be overturned by you expert coders that do so fantastically well in virtually all other things LO. Please teach is tinkerers how to crack this problem.

Is this the most astounding omission in LO usage?

I wish there were no more serious problems than this niche case.

https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=30999

As written by @Zizi64:

Using a serial port (communicate over a serial line/protocoll) inside the AOO/LO: it is a dead project today. Use a standalone software application for send and seceive data.

Hi @mikekaganski, could it be done through Menu/Data Stream?, maybe it’s possible to set up a com port as source.

Niche? OK. If you mean direct data logging directly in Calc using Calc BASIC or Calc python script as opposed to doing it using a third party, terminal / writing to CSV first or using proprietary software. Fair enough.
But it’s certainly not niche when hundreds of thousands - if not millions - of hobbyists and physical scientists (of which I am both) use serial port comms/data - or at least could use it for great purpose. A huge amount of scientific equipment provides for computers to hook up to the Serial interface.
It’s sheer usefulness why there are numerous ways to do it via Excel! But I really want to leave the world of Windows and Office as doubtless would a great many other people. It is the only thing that forces me to use MS Office right now as LO is powerful enough to replace Office (and I use office a lot)

Thanks for the links, but I had already come across them and they ultimately lead to a dead end, hence my appeal here.

To have a clear and simple set of instructions on how to do it with Calc (in LO6 or 7) would be a huge gift to all people wanting to wave goodbye to MS Office. In fact, I’d even be happy to pay someone to do such a thing to help the LO and scientific community.

@mariosv
There are probably a few ways to do it, but the problem is that it’s not apparent how to actually code it. I’ve put many hours into it and it’s so frustrating when everything you try ends in getting no further forward. Undoubtedly that’s because I’m a mediocre programmer, certainly not a specialist or pro, but I am amazed a good programmer has done it or publicised how to do it.

Calc is a Spreadsheetapplication for general purpose,

“”“It’s proved far too difficult for me - an amateur hobbyist programmer.”""

if its too difficult for you - your far away to be a amateur programmer.

>pip3 install pyserial --user  

dont complain about Calc and start writing by yourself!

@mariosv: interesting idea :slight_smile: According to Setting up Python to work with the serial port - Eli Bendersky's website, it might be interesting to test if URLs like file://./COM1 would work on Windows. I have no COM-attached devices to test, but would actually doubt it would work - but who knows :slight_smile:

@mariosv @mikekaganski: the linked site is from 2009 and the example code is written for python2…

@karolus: the linked page links to the two actual threads; the latter one ends in 2019, and I even cited part of it just below the link.

Or are you talking about the link that I used as a reference to Windows syntax for COM ports system path? then this was just a source for the syntax, and doesn’t have “expiration date” :slight_smile:

Anyway, OP wants to abandon Windows, so that my suggestion was just for my own curiosity :slight_smile:

@LibreOffice_Mike:

but I had already come across them and they ultimately lead to a dead end

Then you have omitted the information like “I have looked [here], [there], and [there], and that didn’t help” - to allow people who tried to help to not waste their time offering you links that you already saw, but kept that in secret.

@karolus gravatar imagekarolus ( 2 hours ago )
OK. fair enough. I’ll deflate my opinion as to how I see myself in regards to programming. But I still would like to know how to do this 1) In Windows with LO in Calc BASIC or in LO Calc using a python script and 2) the ultimate… In Linux (say Linux Mint 20) with LO.Cal internally using Calc BASIC or Calc python script.

I’d be willing to pay for the code. If anyone can help (paid or unpaid) it would be awesome.

And apologies for not saying where I have looked, but the list would be quite long and besides, although I am grateful for the suggested links, the person offering them wasn’t aware that they didn’t get anywhere so probably used the same search pathways as I did.

I am aware pyserial can be used but it’s is python pumping data into a Calc sheet. I want a stand alone LO Calc sheet to have BASIC or a python script embedded as a macro to read the serial port itself. I hope it’s clear.

I didn’t try “Windows port” of C OM yet.

meant to say earlier… “but I am amazed a good programmer has NOT done it or publicised how to do it.”

and besides, … the person offering them wasn’t aware that they didn’t get anywhere …

Heh - again, I posted the citation from the linked link that stated that this is not going to work in current versions - so possibly I knew, would you agree? :stuck_out_tongue_winking_eye:

I am interested in your problem, may be because I used to gather data in the past ('82) from an experimental test rig. This post may be interesting for you to update a calc sheet every x seconds, using a python macro. I would prefer the testWait route, because it allows to run the macro for as long as you want update a calc row dynamically .
The datetime.datetime.now() is providing the ‘changing value’ here. Untortunately I don’t have serial port equipment to investigate a real live situation.
Do you have the code to read a datavalue from the serial port and store it in a variable?

Some interesting suggestions but none so far have helped me achieve the goal… to use LO Calc itself to read and log serial data from the serial port using internal python script or even better ?BASIC… It’s something that I hold to be so useful to people wanting to switch to LO (and Linux) that I’d happily pay 100 Euro’s to someone that manages to code it and publishes it as free and open source software. IAs there’s commercial software available, then it is surely achievable. It would help open LO to many more people and further weaken the Microsoft grip on things.

You mentioned not wanting to use pyserial because it is “python pumping data.” Did you mean because it can’t be used in an embedded macro? On Linux you should be able to install pyserial in the system-wide python and then it can be used in a macro.

Note that your offer of payment is not relevant on this site, which is operated by peers only (in other words, people like you, not paid workers).

Your question is also dependent upon the operating system and the hardware used. Without input from your side, (I tried this, expected that, got this result), the community is not able to help. You wrote “that there are many ways of reading serial data through the serial port which I have successfully managed to do by various ways” (using MS/excel). You could share working code with us, with the aim to transfer it to Calc, or use pyserial in a stand alone version, share that code, and as a next step we can try to give suggestions on how this can be embedded in Calc.

@LibreOffice_Mike,

As far as I understand the above discussed topics, you’ve already got everything available. All you need in your Calc sheet is a Basic library, or Python module, to grab the intended data and execute a Python routine that’ll bridge your serial port using pyserial.

  • while installing pyserial using pip3, to be used with LibreOffice, remains a nightmare under windows
  • doing so using Linux Mint is easy

I lack your knowledge regarding serial communication, but I’m pretty sure you’ll find volunteers in that forum wishing to assist you about other aspects.