Re: [Gambas-user] Keyboard locked -- insisting one more time

2017-05-15 Thread Jussi Lahtinen
Can you both send Xorg.0.log (usually in /var/log/)?


Jussi

On Mon, May 15, 2017 at 5:01 PM, Fernando Cabral <
fernandojosecab...@gmail.com> wrote:

> Gláucio wrote:
> > gda@acer:~$ sudo gambas3
> > [sudo] senha para gda:
> > X Error: BadAccess (attempt to access private resource denied) 10
> > Extension:130 (MIT-SHM)
> >  Minor opcode: 1 (X_ShmAttach)
>  > Resource id:  0x141
>
> I don´t get this error. It runs smoothly. But then, I am running Mint 18.1
> (and the same on the virtual machine...)
>
> It seems Benoît thinks it has to do with keyboard input. He suggested I
> changed Xinput method, but did not give any hints on what to change.
>
> - fernando
>
> 2017-05-15 9:53 GMT-03:00 Glaucio Araujo :
>
> > Let's see...​
> >
> >
> >
> > > Have you installed something different that might have changed
> > > the IDE behavior?
> >
> >
> >
> > ​Not that I know. The problem happened just after Gambas fresh install.
> >
> >
> >
> > >
> > > Now, after running gambas as superuser ("sudo gambas3") I have given up
> > the
> > > keyboard hypothesis (at least for now). I went back to the hypothesis
> > that
> > > it has to do with some file or directory permission. Nevertheless, I
> have
> > > not been able to determine which file or directory it could be. As to
> the
> > > project tree, I have opened it up completely (rwxrwxrwx for the
> > directories
> > > and at least rw-rw-rw- for the files. Even for the hidden ones.  It did
> > not
> > > help.
> > >
> >
> >
> > ​Same here. But I know that it has nothing to do with permissions, since
> > it's possible to paste with the mouse.
> >
> >
> >
> > >
> > >
> > > I have exhausted my bag of tricks so I have resorted to either of two
> > ugly
> > > workarounds:  running gambas as superuser or doing the edition in a
> > virtual
> > > machine. In the last option, I just mount the project tree as a
> directory
> > > in the virtual machine. Then I make the changes in the virtual machine
> > and
> > > test them in the real machine. Cumbersome, but has worked.
> > > I would ask you to try running "sudo gambas3". If you can edit your
> files
> > > as superuser, then it will be very likely that we have exactly the same
> > > problem.
> > >
> >
> >
> > Running as "sudo":
> >
> > gda@acer:~$ sudo gambas3
> > [sudo] senha para gda:
> > X Error: BadAccess (attempt to access private resource denied) 10
> >   Extension:130 (MIT-SHM)
> >   Minor opcode: 1 (X_ShmAttach)
> >   Resource id:  0x141
> >
> >
> > ​+ ​I'm wondering if the editor uses Java. There was some similar issues
> > with keyboards and java code editors on Linux in the past.
> >
> > + I'm also thinking about some Gtk+2/3 missing or conflicting library,
> > since my system has Xubuntu and Gnome 3.24.1
> >
> > + Maybe some Xorg setting could do the trick, as it is the only
> difference
> > I can think between VM/Desktop install.
> >
> >
> >
> > ​Abraço!​
> >
> >
> > ​
> > ​
> > ---
> >
> > Gláucio de Araujo
> >
> > Mail : glaucio.de.ara...@gmail.com
> > TIM  : (11) 95900-7801 (WhatsApp / Telegram)
> > ​
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
>
>
> --
> Fernando Cabral
> Blogue: http://fernandocabral.org
> Twitter: http://twitter.com/fjcabral
> e-mail: fernandojosecab...@gmail.com
> Facebook: f...@fcabral.com.br
> Telegram: +55 (37) 99988-8868
> Wickr ID: fernandocabral
> WhatsApp: +55 (37) 99988-8868
> Skype:  fernandojosecabral
> Telefone fixo: +55 (37) 3521-2183
> Telefone celular: +55 (37) 99988-8868
>
> Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
> nenhum político ou cientista poderá se gabar de nada.
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1101: ODBC driver super buggy 2: rs.max return always negative and always -2 event in lasted

2017-05-15 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1101=L21haW4-

Comment #4 by PICCORO LENZ MCKAY:

for close this bug, we need >
* or update the gambas wiki documentation (please all languajes)
* or provide better handle of the rs.count that perdon me, its very confuse 
provide such method and no retrieve desired results

the gambas documentation said http://gambaswiki.org/wiki/comp/gb.db/result/max 
that returns rs.cound -1 but the rs.count return -1 so this always return -1..

as ZXMARGE said many odbc layers does not provide mechanish to count and offer 
those values

if there its the case, and some implementations are planned this must be market 
in the wiki or let open this bug for now.. i'll watching it!

I noted a obvous problem here! too many mysql here! my-poor-sql its not the 
only DB in the world!



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1100: ODBC driver super buggy 1: rs.count return always negative and only one event in lasted

2017-05-15 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1100=L21haW4-

Comment #9 by PICCORO LENZ MCKAY:

for close this bug, we need >
* or update the gambas wiki documentation (please all languajes)
* or provide better handle of the rs.count that perdon me, its very confuse 
provide such method and no retrieve desired results



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1101: ODBC driver super buggy 2: rs.max return always negative and always -2 event in lasted

2017-05-15 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1101=L21haW4-

Comment #3 by zxMarce:

(sorry for the delay in replying)

Hehe... you're right. But I also quoted IBM's ODBC docs for its DB2, and you 
can also check Easysoft's excellent C tutorials at 
http://www.easysoft.com/developer/languages/c/odbc_tutorial.html. Speaking 
about Easysoft, I myself made a command line ODBC tool to connect with 
ConnectionStrings and run queries in C with Easysoft's tutorials... And I 
absolutely suck at C. That good are those tutorials! 

Also, in case you didn't know, Microsoft was one of the leading forces behind 
drafting ODBC, as this quote from Wikipedia says: 

"ODBC was originally developed by Microsoft and Progress DataDirect during the 
early 1990s, and became the basis for the Call Level Interface (CLI) 
standardized by SQL Access Group in the Unix and mainframe field."

So by using their docs you know that that is the standard. Well, at least 
theirs... They suck at Windows (and OS making and privacy respecting in 
general), yes, but they sometimes pull nice tricks off their hats like ODBC. 
And that is not the only standard they helped draft. 

But anyway both MS and IBM (at least when I read the docs to make the Gambas 
component work again) were kind enough to mark clearly any deviations or 
differences from the standard in their ODBC docs. 

Hope that helps, 
zxMarce.



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread ML
Alex,

Without knowing the protocol/device you're communicating with, I don't
think anyone will be able to give substantial help.
But, after years of interfacing very diverse hardware via RS-232 (fiscal
printers, cash-hanlding hardware, GPS, you name it!), I can tell you
that it's not always easy, and docs sometimes lack info or are plain wrong.
Unfortunately the bulk of my experience with hardware is in VB6...
Maybe you're looking at some kind of protocol wrapper bytes... Can't
really say without the detail.

On 15/05/17 08:52, alexchernoff wrote:
> Thanks, it works (both with .tostring and reading one by one...
> But I get values I don't know how to convert, e.g. where I expect a
> decimal 83 or hex 53 I get byte value of 253 ... Or instead of Decimal
> 15 I get 225 :(
> cheers!


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ​ Re: Keyboard locked -- insisting one more time

2017-05-15 Thread Cristiano Guadagnino
Fernando, did you try setting up a new user on your system and trying to
run gambas as the new user?

Cris



  

Sent with Mailtrack



On Mon, May 15, 2017 at 12:53 PM, Fernando Cabral <
fernandojosecab...@gmail.com> wrote:

> Gláucio
>
> I see our systems and environment are quite similar, although not exactly
> the same. Have you installed something different that might have changed
> the IDE behavior? If I have, I have not been able to determine what it
> could be. What I know for sure is that one moment everything was working,
> next moment it was not anymore. What happened in-between, I can not figure
> out.
>
> Now, after running gambas as superuser ("sudo gambas3") I have given up the
> keyboard hypothesis (at least for now). I went back to the hypothesis that
> it has to do with some file or directory permission. Nevertheless, I have
> not been able to determine which file or directory it could be. As to the
> project tree, I have opened it up completely (rwxrwxrwx for the directories
> and at least rw-rw-rw- for the files. Even for the hidden ones.  It did not
> help.
>
> I have also searched for every single file and directory related to gambas.
> For this I used searches like "locate -i --regex .*gambas.*" and "gbr3" and
> "gbx3", etc. Saved the results to a file and checked file and directory
> permissions. I could not find and thing unexpected.
>
> I have exhausted my bag of tricks so I have resorted to either of two ugly
> workarounds:  running gambas as superuser or doing the edition in a virtual
> machine. In the last option, I just mount the project tree as a directory
> in the virtual machine. Then I make the changes in the virtual machine and
> test them in the real machine. Cumbersome, but has worked.
> I would ask you to try running "sudo gambas3". If you can edit your files
> as superuser, then it will be very likely that we have exactly the same
> problem.
>
> Saudações
>
> - fernando
>
> 2017-05-14 18:19 GMT-03:00 Glaucio Araujo :
>
> > Hi,
> >
> > I'm having exactly the same problem here in Xubuntu 17.04 with Gambas
> 3.9.1
> > and 3.9.2(PPA).
> >
> >
> > ​My system information:
> >
> > [System]
> > Gambas=3.9.2
> > OperatingSystem=Linux
> > Kernel=4.10.0-20-generic
> > Architecture=x86_64
> > Distribution=Ubuntu 17.04
> > Desktop=XFCE
> > Theme=Gtk
> > Language=pt_BR.UTF-8
> > Memory=3829M
> >
> > [Libraries]
> > Cairo=libcairo.so.2.11400.8
> > Curl=libcurl.so.4.4.0
> > DBus=libdbus-1.so.3.14.7
> > GStreamer=libgstreamer-1.0.so.0.1004.0
> > GTK+2=libgtk-x11-2.0.so.0.2400.31
> > GTK+3=libgtk-3.so.0.2200.11
> > OpenGL=libGL.so.1.2.0
> > Poppler=libpoppler.so.64.0.0
> > QT4=libQtCore.so.4.8.7
> > QT5=libQt5Core.so.5.7.1
> > SDL=libSDL-1.2.so.0.11.4
> > SQLite=libsqlite3.so.0.8.6
> >
> > [Environment]
> > CLUTTER_BACKEND=x11
> > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> > DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
> > DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
> > DESKTOP_SESSION=xubuntu
> > DISPLAY=:0.0
> > GB_GUI=gb.qt4
> > GDMSESSION=xubuntu
> > GLADE_CATALOG_PATH=:
> > GLADE_MODULE_PATH=:
> > GLADE_PIXMAP_PATH=:
> > GTK_MODULES=gail:atk-bridge
> > GTK_OVERLAY_SCROLLING=0
> > HOME=
> > J2REDIR=/usr/lib/jvm/java-8-oracle/jre
> > J2SDKDIR=/usr/lib/jvm/java-8-oracle
> > JAVA_HOME=/usr/lib/jvm/java-8-oracle
> > JOURNAL_STREAM=8:23426
> > LANG=pt_BR.UTF-8
> > LANGUAGE=pt_BR:pt:en
> > LOGNAME=
> > MANDATORY_PATH=/usr/share/gconf/xubuntu.mandatory.path
> > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/
> > sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/
> > lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/
> > bin:/usr/lib/jvm/java-8-oracle/jre/bin
> > PWD=
> > QT_ACCESSIBILITY=1
> > QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
> > QT_QPA_PLATFORMTHEME=gtk2
> > SESSION_MANAGER=local/:@/tmp/.ICE-unix/
> > 1227,unix/:/tmp/.ICE-unix/1227
> > SHELL=/bin/bash
> > SHLVL=0
> > SSH_AGENT_PID=1209
> > SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
> > TZ=:/etc/localtime
> > USER=
> > USERNAME=
> > WINDOWPATH=1
> > XAUTHORITY=/run/user/1000/gdm/Xauthority
> > XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
> > XDG_CURRENT_DESKTOP=XFCE
> > XDG_DATA_DIRS=/usr/share/xubuntu:/usr/share/xfce4:<
> > home>/.local/share/flatpak/exports/share/:/var/lib/
> > flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/
> > lib/snapd/desktop:/usr/share
> > XDG_MENU_PREFIX=xfce-
> > XDG_RUNTIME_DIR=/run/user/1000
> > XDG_SEAT=seat0
> > XDG_SESSION_DESKTOP=xubuntu
> > XDG_SESSION_ID=1
> > XDG_SESSION_TYPE=x11
> > XDG_VTNR=1
> > _JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
> > -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel​
> >
> >
> > ---
> >
> > Gláucio de Araujo
> >
> > Mail : glaucio.de.ara...@gmail.com
> > TIM  : (11) 95900-7801 (WhatsApp / Telegram)
> >
> >
> >
> >
> > > Thank you, Tobi for your patience 

Re: [Gambas-user] Keyboard locked -- insisting one more time

2017-05-15 Thread Fernando Cabral
Gláucio wrote:
> gda@acer:~$ sudo gambas3
> [sudo] senha para gda:
> X Error: BadAccess (attempt to access private resource denied) 10
> Extension:130 (MIT-SHM)
>  Minor opcode: 1 (X_ShmAttach)
 > Resource id:  0x141

I don´t get this error. It runs smoothly. But then, I am running Mint 18.1
(and the same on the virtual machine...)

It seems Benoît thinks it has to do with keyboard input. He suggested I
changed Xinput method, but did not give any hints on what to change.

- fernando

2017-05-15 9:53 GMT-03:00 Glaucio Araujo :

> Let's see...​
>
>
>
> > Have you installed something different that might have changed
> > the IDE behavior?
>
>
>
> ​Not that I know. The problem happened just after Gambas fresh install.
>
>
>
> >
> > Now, after running gambas as superuser ("sudo gambas3") I have given up
> the
> > keyboard hypothesis (at least for now). I went back to the hypothesis
> that
> > it has to do with some file or directory permission. Nevertheless, I have
> > not been able to determine which file or directory it could be. As to the
> > project tree, I have opened it up completely (rwxrwxrwx for the
> directories
> > and at least rw-rw-rw- for the files. Even for the hidden ones.  It did
> not
> > help.
> >
>
>
> ​Same here. But I know that it has nothing to do with permissions, since
> it's possible to paste with the mouse.
>
>
>
> >
> >
> > I have exhausted my bag of tricks so I have resorted to either of two
> ugly
> > workarounds:  running gambas as superuser or doing the edition in a
> virtual
> > machine. In the last option, I just mount the project tree as a directory
> > in the virtual machine. Then I make the changes in the virtual machine
> and
> > test them in the real machine. Cumbersome, but has worked.
> > I would ask you to try running "sudo gambas3". If you can edit your files
> > as superuser, then it will be very likely that we have exactly the same
> > problem.
> >
>
>
> Running as "sudo":
>
> gda@acer:~$ sudo gambas3
> [sudo] senha para gda:
> X Error: BadAccess (attempt to access private resource denied) 10
>   Extension:130 (MIT-SHM)
>   Minor opcode: 1 (X_ShmAttach)
>   Resource id:  0x141
>
>
> ​+ ​I'm wondering if the editor uses Java. There was some similar issues
> with keyboards and java code editors on Linux in the past.
>
> + I'm also thinking about some Gtk+2/3 missing or conflicting library,
> since my system has Xubuntu and Gnome 3.24.1
>
> + Maybe some Xorg setting could do the trick, as it is the only difference
> I can think between VM/Desktop install.
>
>
>
> ​Abraço!​
>
>
> ​
> ​
> ---
>
> Gláucio de Araujo
>
> Mail : glaucio.de.ara...@gmail.com
> TIM  : (11) 95900-7801 (WhatsApp / Telegram)
> ​
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fernando Cabral
Blogue: http://fernandocabral.org
Twitter: http://twitter.com/fjcabral
e-mail: fernandojosecab...@gmail.com
Facebook: f...@fcabral.com.br
Telegram: +55 (37) 99988-8868
Wickr ID: fernandocabral
WhatsApp: +55 (37) 99988-8868
Skype:  fernandojosecabral
Telefone fixo: +55 (37) 3521-2183
Telefone celular: +55 (37) 99988-8868

Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
nenhum político ou cientista poderá se gabar de nada.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread d4t4full
 is ASCII for STX, a special char that for some protocols mean "start 
transmission".
Some protocols frame their data payload between chars STX () and ETX().
These also normally use some checksum mechanism either before or right after 
ETX.

Of course it could also be a misleading UTF8 header of some kind resulting from 
raw data to string conversion, but that I cannot tell for sure.

You need a good protocol manual and check low-level comms frames.

Regards,
zxMarce.

On May 15, 2017, 10:42, at 10:42, alexchernoff  wrote:
>Hmm eureka, it's 02 53 = 0x53
>Or 02 25 = 0x25...
>
>Where could that 02 be from?
>
>Cheers!
>
>
>
>--
>View this message in context:
>http://gambas.8142.n7.nabble.com/Serial-I-O-with-byte-data-tp58933p58986.html
>Sent from the gambas-user mailing list archive at Nabble.com.
>
>--
>Check out the vibrant tech community on one of the world's most
>engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>___
>Gambas-user mailing list
>Gambas-user@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread alexchernoff
Hmm eureka, it's 02 53 = 0x53
Or 02 25 = 0x25...

Where could that 02 be from?

Cheers!



--
View this message in context: 
http://gambas.8142.n7.nabble.com/Serial-I-O-with-byte-data-tp58933p58986.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Keyboard locked -- insisting one more time

2017-05-15 Thread Glaucio Araujo
Let's see...​



> Have you installed something different that might have changed
> the IDE behavior?



​Not that I know. The problem happened just after Gambas fresh install.



>
> Now, after running gambas as superuser ("sudo gambas3") I have given up the
> keyboard hypothesis (at least for now). I went back to the hypothesis that
> it has to do with some file or directory permission. Nevertheless, I have
> not been able to determine which file or directory it could be. As to the
> project tree, I have opened it up completely (rwxrwxrwx for the directories
> and at least rw-rw-rw- for the files. Even for the hidden ones.  It did not
> help.
>


​Same here. But I know that it has nothing to do with permissions, since
it's possible to paste with the mouse.



>
>
> I have exhausted my bag of tricks so I have resorted to either of two ugly
> workarounds:  running gambas as superuser or doing the edition in a virtual
> machine. In the last option, I just mount the project tree as a directory
> in the virtual machine. Then I make the changes in the virtual machine and
> test them in the real machine. Cumbersome, but has worked.
> I would ask you to try running "sudo gambas3". If you can edit your files
> as superuser, then it will be very likely that we have exactly the same
> problem.
>


Running as "sudo":

gda@acer:~$ sudo gambas3
[sudo] senha para gda:
X Error: BadAccess (attempt to access private resource denied) 10
  Extension:130 (MIT-SHM)
  Minor opcode: 1 (X_ShmAttach)
  Resource id:  0x141


​+ ​I'm wondering if the editor uses Java. There was some similar issues
with keyboards and java code editors on Linux in the past.

+ I'm also thinking about some Gtk+2/3 missing or conflicting library,
since my system has Xubuntu and Gnome 3.24.1

+ Maybe some Xorg setting could do the trick, as it is the only difference
I can think between VM/Desktop install.



​Abraço!​


​
​
---

Gláucio de Araujo

Mail : glaucio.de.ara...@gmail.com
TIM  : (11) 95900-7801 (WhatsApp / Telegram)
​
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread alexchernoff
Thanks, it works (both with .tostring and reading one by one... 

But I get values I don't know how to convert, e.g. where I expect a decimal
83 or hex 53 I get byte value of 253 ... Or instead of Decimal 15 I get 225
:(

cheers!



--
View this message in context: 
http://gambas.8142.n7.nabble.com/Serial-I-O-with-byte-data-tp58933p58984.html
Sent from the gambas-user mailing list archive at Nabble.com.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread nando_f
My reply to the comment:

> Gambas Strings are not null-terminated and can
> contain any sequence of bytes, which includes non-printable characters
> (which I think is what you meant by "unreadable" characters).

You should always consider String as an array of bytes.
Just because humans can't read them or because they cannot be displayed,
means nothing to the computer.  It only means something to the human.

While the computer is processing and doing work, we don't need to see it.

I use string exclusively for binary data...especially serial port stuff.
Strings are far easier than a byte array.

If you insist on using a byte array, consider a large fixed-size array.
For example: b[1].
Resizing a dynamic array every time is cpu work.

-Fernando


--
Open WebMail Project (http://openwebmail.org)


-- Original Message ---
From: Mike Crean 
To: mailing list for gambas users 
Sent: Mon, 15 May 2017 10:46:01 + (UTC)
Subject: Re: [Gambas-user] Serial I/O with byte data

> If you are talking about a byte the likes of that used in modbusrtu you will 
> need to do some high low bit manipulation on it. RegardsMike
> 
> On Monday, 15 May 2017, 13:19, Alexie  wrote:
> 
>  Following should work for you:
> 
> Public Sub XXX_Read()
> 
>   Dim iLen As Integer
>   Dim aData As Byte[]
> 
>   iLen = Lof(Last)
>   aData = New Byte[]
>   aData.Resize(iLen)
>   Try aData.Read(Last, 0, iLen)
> 
> End
> 
> You need to get the length (lof) first, then resize array ... only then you
> can read it.
> 
> 2017-05-14 21:56 GMT+02:00 Tobias Boege :
> 
> > On Sun, 14 May 2017, alexchernoff wrote:
> > > Good day all,
> > >
> > > Anyone know how to read data received on serial port into an array of
> > bytes
> > > instead of string?
> > >
> >
> > I think that's not possible.
> >
> > > String gets unreadable binary characters, so how can I
> > > put them into byte[] or so?
> > >
> >
> > This shouldn't be a problem. Gambas Strings are not null-terminated and can
> > contain any sequence of bytes, which includes non-printable characters
> > (which
> > I think is what you meant by "unreadable" characters).
> >
> > If you insist on a Byte[], read it into a String and use
> > Byte[].FromString(),
> > but there is no way to go around the String, AFAICT (and that is because
> > there is no need to, as Strings can handle binary data just fine).
> >
> > Regards,
> > Tobi
> >
> > --
> > "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> >
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Gambas-user mailing list
> > Gambas-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
--- End of Original Message ---


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread Mike Crean
If you are talking about a byte the likes of that used in modbusrtu you will 
need to do some high low bit manipulation on it.
RegardsMike
 

On Monday, 15 May 2017, 13:19, Alexie  wrote:
 

 Following should work for you:

Public Sub XXX_Read()

  Dim iLen As Integer
  Dim aData As Byte[]

  iLen = Lof(Last)
  aData = New Byte[]
  aData.Resize(iLen)
  Try aData.Read(Last, 0, iLen)

End

You need to get the length (lof) first, then resize array ... only then you
can read it.

2017-05-14 21:56 GMT+02:00 Tobias Boege :

> On Sun, 14 May 2017, alexchernoff wrote:
> > Good day all,
> >
> > Anyone know how to read data received on serial port into an array of
> bytes
> > instead of string?
> >
>
> I think that's not possible.
>
> > String gets unreadable binary characters, so how can I
> > put them into byte[] or so?
> >
>
> This shouldn't be a problem. Gambas Strings are not null-terminated and can
> contain any sequence of bytes, which includes non-printable characters
> (which
> I think is what you meant by "unreadable" characters).
>
> If you insist on a Byte[], read it into a String and use
> Byte[].FromString(),
> but there is no way to go around the String, AFAICT (and that is because
> there is no need to, as Strings can handle binary data just fine).
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


   
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ​ Re: Keyboard locked -- insisting one more time

2017-05-15 Thread Fernando Cabral
Gláucio

I see our systems and environment are quite similar, although not exactly
the same. Have you installed something different that might have changed
the IDE behavior? If I have, I have not been able to determine what it
could be. What I know for sure is that one moment everything was working,
next moment it was not anymore. What happened in-between, I can not figure
out.

Now, after running gambas as superuser ("sudo gambas3") I have given up the
keyboard hypothesis (at least for now). I went back to the hypothesis that
it has to do with some file or directory permission. Nevertheless, I have
not been able to determine which file or directory it could be. As to the
project tree, I have opened it up completely (rwxrwxrwx for the directories
and at least rw-rw-rw- for the files. Even for the hidden ones.  It did not
help.

I have also searched for every single file and directory related to gambas.
For this I used searches like "locate -i --regex .*gambas.*" and "gbr3" and
"gbx3", etc. Saved the results to a file and checked file and directory
permissions. I could not find and thing unexpected.

I have exhausted my bag of tricks so I have resorted to either of two ugly
workarounds:  running gambas as superuser or doing the edition in a virtual
machine. In the last option, I just mount the project tree as a directory
in the virtual machine. Then I make the changes in the virtual machine and
test them in the real machine. Cumbersome, but has worked.
I would ask you to try running "sudo gambas3". If you can edit your files
as superuser, then it will be very likely that we have exactly the same
problem.

Saudações

- fernando

2017-05-14 18:19 GMT-03:00 Glaucio Araujo :

> Hi,
>
> I'm having exactly the same problem here in Xubuntu 17.04 with Gambas 3.9.1
> and 3.9.2(PPA).
>
>
> ​My system information:
>
> [System]
> Gambas=3.9.2
> OperatingSystem=Linux
> Kernel=4.10.0-20-generic
> Architecture=x86_64
> Distribution=Ubuntu 17.04
> Desktop=XFCE
> Theme=Gtk
> Language=pt_BR.UTF-8
> Memory=3829M
>
> [Libraries]
> Cairo=libcairo.so.2.11400.8
> Curl=libcurl.so.4.4.0
> DBus=libdbus-1.so.3.14.7
> GStreamer=libgstreamer-1.0.so.0.1004.0
> GTK+2=libgtk-x11-2.0.so.0.2400.31
> GTK+3=libgtk-3.so.0.2200.11
> OpenGL=libGL.so.1.2.0
> Poppler=libpoppler.so.64.0.0
> QT4=libQtCore.so.4.8.7
> QT5=libQt5Core.so.5.7.1
> SDL=libSDL-1.2.so.0.11.4
> SQLite=libsqlite3.so.0.8.6
>
> [Environment]
> CLUTTER_BACKEND=x11
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
> DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
> DESKTOP_SESSION=xubuntu
> DISPLAY=:0.0
> GB_GUI=gb.qt4
> GDMSESSION=xubuntu
> GLADE_CATALOG_PATH=:
> GLADE_MODULE_PATH=:
> GLADE_PIXMAP_PATH=:
> GTK_MODULES=gail:atk-bridge
> GTK_OVERLAY_SCROLLING=0
> HOME=
> J2REDIR=/usr/lib/jvm/java-8-oracle/jre
> J2SDKDIR=/usr/lib/jvm/java-8-oracle
> JAVA_HOME=/usr/lib/jvm/java-8-oracle
> JOURNAL_STREAM=8:23426
> LANG=pt_BR.UTF-8
> LANGUAGE=pt_BR:pt:en
> LOGNAME=
> MANDATORY_PATH=/usr/share/gconf/xubuntu.mandatory.path
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/
> sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/
> lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/
> bin:/usr/lib/jvm/java-8-oracle/jre/bin
> PWD=
> QT_ACCESSIBILITY=1
> QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
> QT_QPA_PLATFORMTHEME=gtk2
> SESSION_MANAGER=local/:@/tmp/.ICE-unix/
> 1227,unix/:/tmp/.ICE-unix/1227
> SHELL=/bin/bash
> SHLVL=0
> SSH_AGENT_PID=1209
> SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
> TZ=:/etc/localtime
> USER=
> USERNAME=
> WINDOWPATH=1
> XAUTHORITY=/run/user/1000/gdm/Xauthority
> XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
> XDG_CURRENT_DESKTOP=XFCE
> XDG_DATA_DIRS=/usr/share/xubuntu:/usr/share/xfce4:<
> home>/.local/share/flatpak/exports/share/:/var/lib/
> flatpak/exports/share/:/usr/local/share/:/usr/share/:/var/
> lib/snapd/desktop:/usr/share
> XDG_MENU_PREFIX=xfce-
> XDG_RUNTIME_DIR=/run/user/1000
> XDG_SEAT=seat0
> XDG_SESSION_DESKTOP=xubuntu
> XDG_SESSION_ID=1
> XDG_SESSION_TYPE=x11
> XDG_VTNR=1
> _JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
> -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel​
>
>
> ---
>
> Gláucio de Araujo
>
> Mail : glaucio.de.ara...@gmail.com
> TIM  : (11) 95900-7801 (WhatsApp / Telegram)
>
>
>
>
> > Thank you, Tobi for your patience explaining this whole thing.
> > Your comments make sense. No, as to the keyboard issue,
> > what I can not figure out boils down to two things: First, I have not
> > changed anything. At least that I know of.
> > Second, why I only see the problem with the gambas IDE? Everything else
> is
> > working fine.
> >
> > I also have tried this:
> > a) installed Linux Mint 18.1 in a virtual box
> > b) mounted the original directories in the virtual box
> > c) installed gambas in the virtual machine
> > d) edited the original files in the virtual environment -- no problems
> > whatsoever.
> >
> > The