[Solved] LCD I2C library issue

Hello,

Having trouble to upload my sketch created with previous Mac OS (currently Mac Sierra 10.12.6) I decided using Web Editor.
My sketch works currently with 0S 10.10 and IDE 1.6.7 and I don’t meet this issue (other, but it’s not the topic) with Sierra and latest release of IDE 1.8.3

I’ve imported missing libraries (DHT22 and NewLiquidCrystal) into creator but still have following error during verifying:


arduino-builder/arduino-builder -compile -core-api-version 10611 -build-path /tmp/362539856 -hardware arduino-builder/hardware -hardware arduino-builder/packages/cores -tools arduino-builder/tools -tools arduino-builder/packages/tools -built-in-libraries arduino-builder/latest -libraries /tmp/116639214/pinned -libraries /tmp/116639214/custom -fqbn arduino:avr:nano:cpu=atmega328 -build-cache /tmp -verbose=false /tmp/116639214/_VMC_Intelligente_v1-3
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: /home/admin/builder/arduino-builder/latest/LiquidCrystal I2C-1.1.2
Not used: /tmp/116639214/custom/NewliquidCrystal
Not used: /home/admin/builder/arduino-builder/latest/jm_LiquidCrystal_I2C-1.0.0
/tmp/116639214/_VMC_Intelligente_v1-3/_VMC_Intelligente_v1-3.ino:89:53: error: ‘POSITIVE’ was not declared in this scope
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address, using I2C SCan if necessary
^
exit status 1


Using lastest vers of NewLiquidCrystal (includind LiquidCrystal_I2C.h) I’m not able understanding bolded lines here above. And why it works with IDE and not with web Creator.

Any idea ? Thanks.

Would you mind sharing the sketch you are working on?
You can do so by pressing the SHARE button in the header and coping the sketch URL. If it has sensitive info you can send it to me via PM too.

Thanks!

Could you tell us if you are using an example with PDE or INO extensions ?
If it is a PDE then re-save it as that will convert it to an INO extension and it might get you a little further.

Have put together an I2C display (16x02) to play with here so if you could share the link to your web sketch I can take a look and see what happens here.

EDIT Have you tried an I2C scanner to see if that can see your device on the buss.

Hello,

sorry I was away from you for a while. I've got new issue with this sketch using IDE.

First, sketch is here : Arduino Cloud

Then, I told you this sketch works on OS 10.10 but it doesn't with Sierra (DHT22 lib ?). I can upload (no error at all) it to Nano but Nano reboot three or for times then DHTs return wrong informations. But this point is a different matter than original object of this topic.

I know i should change dht lib... but it works depending on OS, so code is quite good.

Seeing my sketch, if you get an idea about trouble mentionned before especially with web creator, let me know.

Thanks a lot.

I wonder if you uploaded a very specific DHT library as it will not compile here and gives a library error.

Could you link directly to the lib you used please.

Maybe its an old one that is not maintained or available to CREATE ?

ballscrewbob:
Could you tell us if you are using an example with PDE or INO extensions ?
If it is a PDE then re-save it as that will convert it to an INO extension and it might get you a little further.

Have put together an I2C display (16x02) to play with here so if you could share the link to your web sketch I can take a look and see what happens here.

EDIT Have you tried an I2C scanner to see if that can see your device on the buss.

Hi,

no matter with I2C adress. I've done it at the begining. In this case there is no trouble for compliation but just for operating.

I probably found something. There are two ways for instanciation in LCD_I2C lib (.h):

// Created by Francisco Malpartida on 20/08/11.
// Copyright 2011 - Under creative commons license 3.0:
// Attribution-ShareAlike CC BY-SA
(...)
public:

_ /*!_

  • @method *

  • @abstract Class constructor.*

  • @discussion Initializes class variables and defines the I2C address of the*

  • LCD. The constructor does not initialize the LCD.*

  • @param lcd_Addr[in] I2C address of the IO expansion module. For I2CLCDextraIO,*

  • the address can be configured using the on board jumpers.*
    _ */_

  • LiquidCrystal_I2C (uint8_t lcd_Addr);*

  • // Constructor with backlight control*

  • LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);*

and kind of the same next in this lib
So, how CREATE (or IDE but it works) made the difference with or without backlight control ?
That is probably the source of trouble in CREATE.

Note : Compilation (verifying) WORKS perfectly with IDE (1.6.8 to 1.8.3) choosing Nano board. Trouble appears ONLY with Create
All LCD_I2C lib are contains in one folder "NewLiquidCrystal" on my computer, it could make the difference, don't know.
So... I'm lost.
Thanks.

Please use code tags to post error and sketches ( </> )
As you can see the forum does strange things when you don’t use those tags.

Did you upload your library to CREATE ?
CREATE has a very good selection of libs but NOT every one that has ever been made.

Also would still like the actual link to where you acquired it ???
The date suggest it may be a rather old one and it might not have been maintained or CREATE compliant.

Quick video of how to import a lib here
just in case you didn’t import it.

Hi,

Yes I did. I uploaded it to my Create.
Your probably right saying it's an old one. As written on error code, CREATE use 1.1.2 instead of mine (1.?.?). Meaning CREATE doesn't use imported library.

I've seen LiquidCrystal_I2C has a new version released 6month ago (on Github). But this one is not include in a package as the previous one named NewLiquidCrystal.

bitbucket.org / fmalpartida / new-liquidcrystal / downloads

LiquidCrystal_I2C.h (or .cpp) is dated on Jun2015.

I should and could "clean" folders of libraries i've got, but I'm "affraid" upgrading because it works with my IDE.

When I decided to use CREATE it was due to trouble I had on another sketch and to fix trouble met with OS Sierra (I think) on this sketch, but finally I got new issues... A little bit boring isn't it ? :confused:

hi @Excalibur83
I am trying to compile your sketch, could you provide the custom DHT22 library you are using?

Hello, thanks for your help (all)

Here dropbox link of my lib : Dropbox Excalibur - DHT22

Do you try with Create or IDE ?

Could you also supply the link to the original source ?

I am getting an error when I try to import the DHT22 library, we are going to investigate why is that. Can you upload it without issues?

00alis : Yes I did ti without any problem (see attached file, if it works…)

ballscrewbob : Here it is : Github DHT22

Capture d’écran 2017-09-12 à 17.47.07.pdf (262 KB)

ok its a 6 year old lib that has not really been maintained for at least 4 years.

if it were me I would move on from that lib unless there is a very special reason to use it.

You’re right. I wrote that and i should move to DHT lib developped by Ada.
But that lib is easier to implement in a sktech. Reason why I use it since quite the begining.

If I change (it’s planned, see text in french - ok, I know… :blush: - in my sketch), I must re-write my sketch. Iknow it’s not a big job, time just missing.

However trouble seems not coming from DHT22 lib but from LiquidCrystal_I2C used with Create (as written many time before)

Thanks for your support.

Ok I deleted all my custom libraries and now I am able to import DHT22, I am currently not able to import NewLiquidCristal_1.3.4 :frowning:

Are you? There are some odd problems with these 2 libraries anyway, we are keeping investigating

YEs I did. You can see it on picture (pdf) I let. There are only both which I've imported into Create.

See U

I also confirm the issue with NewLiquidCristal_1.3.4. I unzipped the file and then zipped it again with the same folder structure and file name as the original and then I can import it.

I know this same issue was raised previously but I don't know whether we found any more information at that time. @ballscewbob, do you remember that?

And boy what an annoying library to have to test imports with over and over again. What was the author thinking putting a 17 MB .tmp file in an Arduino library?

The limit for imports is 10MB so it will always fail as the original.

Do seem to remember a version of new liquid having some issues but that was a long time ago.

I did a basic write up for importing libs. am attaching here as it seems quite useful at the moment.

Importing sketches and libraries.pdf (285 KB)

ballscrewbob:
The limit for imports is 10MB so it will always fail as the original.

Compressed or uncompressed size?

The original file downloaded from https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/NewliquidCrystal_1.3.4.zip that fails the import is 6125 kB compressed. My re-zip that successfully imports is 6186 kB compressed so I don't think the 10 MB size limit could be the cause of the failure.