Hi,
On Mon, Jul 9, 2012 at 7:08 AM, Tim Van Der Hulst <[hidden email]> wrote: > related: > > http://elua-development.2368040.n2.nabble.com/Problem-to-import-module-in-eLua-LM3S-td7455874.html > > Can someone confirm for STM32 the "require" function works? The "require" function is definitely NOT platform dependent. I was on vacation and I just returned today, I will test "require" as soon as I can. In the meantime, can you please execute "cat /mmc/test.lua" from the shell and confirm that it shows the correct data? Thanks, Bogdan > > TiM > > > > ----- Original Message ----- > From: "Tim Van Der Hulst" <[hidden email]> > To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> > Sent: Monday, July 9, 2012 4:00:02 PM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > I most definately have > > module(...) > > in my file, yet it still fails! > > received and saved as /mmc/gprs.lua > eLua# recv > Waiting for file .done, got 641 bytes > -------------- > Error: [string "xmodem"]:26: module 'gprs' not found: > no field package.preload['gprs'] > no file '/mmc/gprs.lua;/mmc/gprs.lc;/rom/gprs.lua;/rom/gprs.lc' > no file '/mmc/gprs.lc;/rom/gprs.lua;/rom/gprs.lc' > no file '/rom/gprs.lua;/rom/gprs.lc' > no file '/rom/gprs.lc' > eLua# > > -------- > > I see a very old (2008) thread semi related: > > https://lists.berlios.de/pipermail/elua-dev/2008-November/000102.html > > [eLua-dev] Require(path/modulename) > > -------- > > Not sure what to test further, > > TiM > > > > ----- Original Message ----- > From: "Thiago Naves" <[hidden email]> > To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> > Sent: Friday, July 6, 2012 12:47:59 PM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > > Add > local module_name = module_name > > like > > local pio = pio > local uart = uart > local string = string > > for each module you wish to use in the code at the beginning of your file, > then add a > > module (...) > > after that to make you file into a module. > > Then you'll be able to use the require, but the dofile will not work. > > I've attached my MIDI module as an example. > > > Best, > Thiago > > > > > On Thu, Jul 5, 2012 at 6:31 PM, Tim Van Der Hulst < [hidden email] > wrote: > > > Hi there, > > Might be coffee time but... > > dofile('/mmc/test.lua') -- OK > require('test') -- Fail!! > > ------------- > /mmc > test.txt 5 bytes > gprs.lua 2910 bytes > util.lua 385 bytes > test.lua 385 bytes > > Total on /mmc: 3685 bytes > > ------------- > > Error: [string "xmodem"]:23: module 'test' not found: > no field package.preload['test'] > no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > no file '/rom/test.lua;/rom/ test.lc ' > no file '/rom/ test.lc ' > > ------------ > > I'm running on platform STM32 > The CPU is a STM32F103RE > The board name is ET-STM32 > > ------------ > > Help please! > > TiM > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > > > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
In reply to this post by Tim Van Der Hulst
Hi,
On Sun, Jul 8, 2012 at 11:52 PM, Tim Van Der Hulst <[hidden email]> wrote: > Hi, > > Wiki has some text (but no links/content) to GSM / GPRS: > > GSM / GPRS > Q64 and Q100 - Wavecom/Sierra Wireless GPRS modems support for eLua > TC65 - Siemens GPRS modem support for eLua > Radio links > 2.4GHz - > > ---------------------- > > Anyone have further light on this? > > Implementing some or most of the application logic/guidelines here is my ideal goal: > > http://m2m.com/docs/DOC-1007 > Tech Notes - Connected Device Design Guidelines and Common AT Commands > > Will keep developing my own library in case others interested but keen to find other code samples as I am an ELua That would be eLua :) > noobie. That's alright. Excellent idea BTW, I'm sure lost of people would be interested in a GPRS/GSM library, so I'd keep working on that module. If you get stuck, just ask for help on this list and I'm sure someone will reply to you. Best, Bogdan > > TiM > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
If you can, make the implementation such that the underlying comms can be any character device. It would be very useful if your library could support hfp over Bluetooth, that way any phone with Bluetooth support could be used as well. On Jul 9, 2012 2:29 PM, "Bogdan Marinescu" <[hidden email]> wrote:
Hi, _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Marcus Vinicius Costa |
In reply to this post by BogdanM
Hi all.
The module works perfectly in LM3S, I had problems at first but they were a hardware problem. But when I migrated to board MIZAR32 I had the same problem as you, it does not found the module (the same code that was used on board LM3S).
To solve my problem, I discovered that it was not split terms in the path (;) to search the file using require, it can be seen in the debug you posted.
In this case, the module find correctly only on '/rom/test.lc'
where would be the correct (observed on board LM3S)
To solve my problem I changed the file "luaconf.h" in line 110 as follows.
to
So it goes to look for the compiled file only in the MMC. This change solved my problem but not fixed the bug. I hope I have helped Marcus Vinicius
2012/7/9 Bogdan Marinescu <[hidden email]> Hi, _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Tim Van Der Hulst |
In reply to this post by BogdanM
yep I can definately read the file via cat and call it with "dofile" just fine :(
----- Original Message ----- From: "Bogdan Marinescu" <[hidden email]> To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> Sent: Tuesday, July 10, 2012 6:26:13 AM Subject: Re: [eLua-dev] mmc - dofile OK, require Fails Hi, On Mon, Jul 9, 2012 at 7:08 AM, Tim Van Der Hulst <[hidden email]> wrote: > related: > > http://elua-development.2368040.n2.nabble.com/Problem-to-import-module-in-eLua-LM3S-td7455874.html > > Can someone confirm for STM32 the "require" function works? The "require" function is definitely NOT platform dependent. I was on vacation and I just returned today, I will test "require" as soon as I can. In the meantime, can you please execute "cat /mmc/test.lua" from the shell and confirm that it shows the correct data? Thanks, Bogdan > > TiM > > > > ----- Original Message ----- > From: "Tim Van Der Hulst" <[hidden email]> > To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> > Sent: Monday, July 9, 2012 4:00:02 PM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > I most definately have > > module(...) > > in my file, yet it still fails! > > received and saved as /mmc/gprs.lua > eLua# recv > Waiting for file .done, got 641 bytes > -------------- > Error: [string "xmodem"]:26: module 'gprs' not found: > no field package.preload['gprs'] > no file '/mmc/gprs.lua;/mmc/gprs.lc;/rom/gprs.lua;/rom/gprs.lc' > no file '/mmc/gprs.lc;/rom/gprs.lua;/rom/gprs.lc' > no file '/rom/gprs.lua;/rom/gprs.lc' > no file '/rom/gprs.lc' > eLua# > > -------- > > I see a very old (2008) thread semi related: > > https://lists.berlios.de/pipermail/elua-dev/2008-November/000102.html > > [eLua-dev] Require(path/modulename) > > -------- > > Not sure what to test further, > > TiM > > > > ----- Original Message ----- > From: "Thiago Naves" <[hidden email]> > To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> > Sent: Friday, July 6, 2012 12:47:59 PM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > > Add > local module_name = module_name > > like > > local pio = pio > local uart = uart > local string = string > > for each module you wish to use in the code at the beginning of your file, > then add a > > module (...) > > after that to make you file into a module. > > Then you'll be able to use the require, but the dofile will not work. > > I've attached my MIDI module as an example. > > > Best, > Thiago > > > > > On Thu, Jul 5, 2012 at 6:31 PM, Tim Van Der Hulst < [hidden email] > wrote: > > > Hi there, > > Might be coffee time but... > > dofile('/mmc/test.lua') -- OK > require('test') -- Fail!! > > ------------- > /mmc > test.txt 5 bytes > gprs.lua 2910 bytes > util.lua 385 bytes > test.lua 385 bytes > > Total on /mmc: 3685 bytes > > ------------- > > Error: [string "xmodem"]:23: module 'test' not found: > no field package.preload['test'] > no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > no file '/rom/test.lua;/rom/ test.lc ' > no file '/rom/ test.lc ' > > ------------ > > I'm running on platform STM32 > The CPU is a STM32F103RE > The board name is ET-STM32 > > ------------ > > Help please! > > TiM > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > > > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Tim Van Der Hulst |
In reply to this post by Marcus Vinicius Costa
aha yep I did start playing around with luaconf.h yesterday to try to get it working also, I'll try just the /mmc path for now!~
Oops it works, hooray~ Thanks for the workaround!! TiM ----- Original Message ----- From: "Marcus Vinicius Costa" <[hidden email]> To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> Sent: Tuesday, July 10, 2012 8:07:19 AM Subject: Re: [eLua-dev] mmc - dofile OK, require Fails Hi all. The module works perfectly in LM3S, I had problems at first but they were a hardware problem. But when I migrated to board MIZAR32 I had the same problem as you, it does not found the module (the same code that was used on board LM3S). To solve my problem, I discovered that it was not split terms in the path (;) to search the file using require, it can be seen in the debug you posted. Error: [string "xmodem"]:23: module 'test' not found: no field package.preload['test'] no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' no file '/rom/test.lua;/rom/ test.lc ' no file '/rom/ test.lc ' In this case, the module find correctly only on '/rom/ test.lc ' where would be the correct (observed on board LM3S) Error: [string "xmodem"]:23: module 'test' not found: no field package.preload['test'] no file '/mmc/test.lua' no file '/mmc/ test.lc ' no file '/rom/test.lua' no file '/rom/ test.lc ' To solve my problem I changed the file "luaconf.h" in line 110 as follows. #define LUA_PATH_DEFAULT "/mmc/?.lua;/mmc/?.lc;/rom/?.lua;/rom/?.lc" to #define LUA_PATH_DEFAULT "/mmc/?.lc" So it goes to look for the compiled file only in the MMC. This change solved my problem but not fixed the bug. I hope I have helped Marcus Vinicius 2012/7/9 Bogdan Marinescu < [hidden email] > Hi, On Mon, Jul 9, 2012 at 7:08 AM, Tim Van Der Hulst < [hidden email] > wrote: > related: > > http://elua-development.2368040.n2.nabble.com/Problem-to-import-module-in-eLua-LM3S-td7455874.html > > Can someone confirm for STM32 the "require" function works? The "require" function is definitely NOT platform dependent. I was on vacation and I just returned today, I will test "require" as soon as I can. In the meantime, can you please execute "cat /mmc/test.lua" from the shell and confirm that it shows the correct data? Thanks, Bogdan > > TiM > > > > ----- Original Message ----- > From: "Tim Van Der Hulst" < [hidden email] > > To: "eLua Users and Development List ( www.eluaproject.net )" < [hidden email] > > Sent: Monday, July 9, 2012 4:00:02 PM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > I most definately have > > module(...) > > in my file, yet it still fails! > > received and saved as /mmc/gprs.lua > eLua# recv > Waiting for file .done, got 641 bytes > -------------- > Error: [string "xmodem"]:26: module 'gprs' not found: > no field package.preload['gprs'] > no file '/mmc/gprs.lua;/mmc/ gprs.lc ;/rom/gprs.lua;/rom/ gprs.lc ' > no file '/mmc/ gprs.lc ;/rom/gprs.lua;/rom/ gprs.lc ' > no file '/rom/gprs.lua;/rom/ gprs.lc ' > no file '/rom/ gprs.lc ' > eLua# > > -------- > > I see a very old (2008) thread semi related: > > https://lists.berlios.de/pipermail/elua-dev/2008-November/000102.html > > [eLua-dev] Require(path/modulename) > > -------- > > Not sure what to test further, > > TiM > > > > ----- Original Message ----- > From: "Thiago Naves" < [hidden email] > > To: "eLua Users and Development List ( www.eluaproject.net )" < [hidden email] > > Sent: Friday, July 6, 2012 12:47:59 PM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > > Add > local module_name = module_name > > like > > local pio = pio > local uart = uart > local string = string > > for each module you wish to use in the code at the beginning of your file, > then add a > > module (...) > > after that to make you file into a module. > > Then you'll be able to use the require, but the dofile will not work. > > I've attached my MIDI module as an example. > > > Best, > Thiago > > > > > On Thu, Jul 5, 2012 at 6:31 PM, Tim Van Der Hulst < [hidden email] > wrote: > > > Hi there, > > Might be coffee time but... > > dofile('/mmc/test.lua') -- OK > require('test') -- Fail!! > > ------------- > /mmc > test.txt 5 bytes > gprs.lua 2910 bytes > util.lua 385 bytes > test.lua 385 bytes > > Total on /mmc: 3685 bytes > > ------------- > > Error: [string "xmodem"]:23: module 'test' not found: > no field package.preload['test'] > no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > no file '/rom/test.lua;/rom/ test.lc ' > no file '/rom/ test.lc ' > > ------------ > > I'm running on platform STM32 > The CPU is a STM32F103RE > The board name is ET-STM32 > > ------------ > > Help please! > > TiM > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > > > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev _______________________________________________ eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
On Mon, Jul 9, 2012 at 11:37 PM, Tim Van Der Hulst <[hidden email]> wrote:
> aha yep I did start playing around with luaconf.h yesterday to try to get it working also, I'll try just the /mmc path for now!~ > > Oops it works, hooray~ > > Thanks for the workaround!! Nice, I'm glad it works for you. Also, very weird bug. Could you please open a bug on our tracker (http://tracker.eluaproject.net)? Thanks, Bogdan > > TiM > > > ----- Original Message ----- > From: "Marcus Vinicius Costa" <[hidden email]> > To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> > Sent: Tuesday, July 10, 2012 8:07:19 AM > Subject: Re: [eLua-dev] mmc - dofile OK, require Fails > > > Hi all. > > > > The module works perfectly in LM3S, I had problems at first but they were a hardware problem. > > > But when I migrated to board MIZAR32 I had the same problem as you, it does not found the module (the same code that was used on board LM3S). > > > To solve my problem, I discovered that it was not split terms in the path (;) to search the file using require, it can be seen in the debug you posted. > > > > > > Error: [string "xmodem"]:23: module 'test' not found: > > no field package.preload['test'] > > no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > > no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' > > no file '/rom/test.lua;/rom/ test.lc ' > > no file '/rom/ test.lc ' > > > > In this case, the module find correctly only on '/rom/ test.lc ' > > > where would be the correct (observed on board LM3S) > > > > > > Error: [string "xmodem"]:23: module 'test' not found: > > no field package.preload['test'] > > no file '/mmc/test.lua' > > no file '/mmc/ test.lc ' > > no file '/rom/test.lua' > > no file '/rom/ test.lc ' > > > > > > To solve my problem I changed the file "luaconf.h" in line 110 as follows. > > > > > > #define LUA_PATH_DEFAULT "/mmc/?.lua;/mmc/?.lc;/rom/?.lua;/rom/?.lc" > > > > to > > > > > > #define LUA_PATH_DEFAULT "/mmc/?.lc" > > > > So it goes to look for the compiled file only in the MMC. This change solved my problem but not fixed the bug. > > > I hope I have helped > Marcus Vinicius > > 2012/7/9 Bogdan Marinescu < [hidden email] > > > > Hi, > > > On Mon, Jul 9, 2012 at 7:08 AM, Tim Van Der Hulst < [hidden email] > wrote: >> related: >> >> http://elua-development.2368040.n2.nabble.com/Problem-to-import-module-in-eLua-LM3S-td7455874.html >> >> Can someone confirm for STM32 the "require" function works? > > The "require" function is definitely NOT platform dependent. I was on > vacation and I just returned today, I will test "require" as soon as I > can. In the meantime, can you please execute "cat /mmc/test.lua" from > the shell and confirm that it shows the correct data? > > Thanks, > Bogdan > > > >> >> TiM >> >> >> >> ----- Original Message ----- >> From: "Tim Van Der Hulst" < [hidden email] > >> To: "eLua Users and Development List ( www.eluaproject.net )" < [hidden email] > >> Sent: Monday, July 9, 2012 4:00:02 PM >> Subject: Re: [eLua-dev] mmc - dofile OK, require Fails >> >> I most definately have >> >> module(...) >> >> in my file, yet it still fails! >> >> received and saved as /mmc/gprs.lua >> eLua# recv >> Waiting for file .done, got 641 bytes >> -------------- >> Error: [string "xmodem"]:26: module 'gprs' not found: >> no field package.preload['gprs'] >> no file '/mmc/gprs.lua;/mmc/ gprs.lc ;/rom/gprs.lua;/rom/ gprs.lc ' >> no file '/mmc/ gprs.lc ;/rom/gprs.lua;/rom/ gprs.lc ' >> no file '/rom/gprs.lua;/rom/ gprs.lc ' >> no file '/rom/ gprs.lc ' >> eLua# >> >> -------- >> >> I see a very old (2008) thread semi related: >> >> https://lists.berlios.de/pipermail/elua-dev/2008-November/000102.html >> >> [eLua-dev] Require(path/modulename) >> >> -------- >> >> Not sure what to test further, >> >> TiM >> >> >> >> ----- Original Message ----- >> From: "Thiago Naves" < [hidden email] > >> To: "eLua Users and Development List ( www.eluaproject.net )" < [hidden email] > >> Sent: Friday, July 6, 2012 12:47:59 PM >> Subject: Re: [eLua-dev] mmc - dofile OK, require Fails >> >> >> Add >> local module_name = module_name >> >> like >> >> local pio = pio >> local uart = uart >> local string = string >> >> for each module you wish to use in the code at the beginning of your file, >> then add a >> >> module (...) >> >> after that to make you file into a module. >> >> Then you'll be able to use the require, but the dofile will not work. >> >> I've attached my MIDI module as an example. >> >> >> Best, >> Thiago >> >> >> >> >> On Thu, Jul 5, 2012 at 6:31 PM, Tim Van Der Hulst < [hidden email] > wrote: >> >> >> Hi there, >> >> Might be coffee time but... >> >> dofile('/mmc/test.lua') -- OK >> require('test') -- Fail!! >> >> ------------- >> /mmc >> test.txt 5 bytes >> gprs.lua 2910 bytes >> util.lua 385 bytes >> test.lua 385 bytes >> >> Total on /mmc: 3685 bytes >> >> ------------- >> >> Error: [string "xmodem"]:23: module 'test' not found: >> no field package.preload['test'] >> no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' >> no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' >> no file '/rom/test.lua;/rom/ test.lc ' >> no file '/rom/ test.lc ' >> >> ------------ >> >> I'm running on platform STM32 >> The CPU is a STM32F103RE >> The board name is ET-STM32 >> >> ------------ >> >> Help please! >> >> TiM >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > > > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Interestingly enough, this turned out to be a bug in the read-only
string implementation (a recent memory optimization added to eLua). Thanks for the report! Fixed on master, you can revert to the regular LUA_PATH now. Best, Bogdan On Tue, Jul 10, 2012 at 11:31 AM, Bogdan Marinescu <[hidden email]> wrote: > On Mon, Jul 9, 2012 at 11:37 PM, Tim Van Der Hulst <[hidden email]> wrote: >> aha yep I did start playing around with luaconf.h yesterday to try to get it working also, I'll try just the /mmc path for now!~ >> >> Oops it works, hooray~ >> >> Thanks for the workaround!! > > Nice, I'm glad it works for you. Also, very weird bug. Could you > please open a bug on our tracker (http://tracker.eluaproject.net)? > > Thanks, > Bogdan > >> >> TiM >> >> >> ----- Original Message ----- >> From: "Marcus Vinicius Costa" <[hidden email]> >> To: "eLua Users and Development List (www.eluaproject.net)" <[hidden email]> >> Sent: Tuesday, July 10, 2012 8:07:19 AM >> Subject: Re: [eLua-dev] mmc - dofile OK, require Fails >> >> >> Hi all. >> >> >> >> The module works perfectly in LM3S, I had problems at first but they were a hardware problem. >> >> >> But when I migrated to board MIZAR32 I had the same problem as you, it does not found the module (the same code that was used on board LM3S). >> >> >> To solve my problem, I discovered that it was not split terms in the path (;) to search the file using require, it can be seen in the debug you posted. >> >> >> >> >> >> Error: [string "xmodem"]:23: module 'test' not found: >> >> no field package.preload['test'] >> >> no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' >> >> no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' >> >> no file '/rom/test.lua;/rom/ test.lc ' >> >> no file '/rom/ test.lc ' >> >> >> >> In this case, the module find correctly only on '/rom/ test.lc ' >> >> >> where would be the correct (observed on board LM3S) >> >> >> >> >> >> Error: [string "xmodem"]:23: module 'test' not found: >> >> no field package.preload['test'] >> >> no file '/mmc/test.lua' >> >> no file '/mmc/ test.lc ' >> >> no file '/rom/test.lua' >> >> no file '/rom/ test.lc ' >> >> >> >> >> >> To solve my problem I changed the file "luaconf.h" in line 110 as follows. >> >> >> >> >> >> #define LUA_PATH_DEFAULT "/mmc/?.lua;/mmc/?.lc;/rom/?.lua;/rom/?.lc" >> >> >> >> to >> >> >> >> >> >> #define LUA_PATH_DEFAULT "/mmc/?.lc" >> >> >> >> So it goes to look for the compiled file only in the MMC. This change solved my problem but not fixed the bug. >> >> >> I hope I have helped >> Marcus Vinicius >> >> 2012/7/9 Bogdan Marinescu < [hidden email] > >> >> >> Hi, >> >> >> On Mon, Jul 9, 2012 at 7:08 AM, Tim Van Der Hulst < [hidden email] > wrote: >>> related: >>> >>> http://elua-development.2368040.n2.nabble.com/Problem-to-import-module-in-eLua-LM3S-td7455874.html >>> >>> Can someone confirm for STM32 the "require" function works? >> >> The "require" function is definitely NOT platform dependent. I was on >> vacation and I just returned today, I will test "require" as soon as I >> can. In the meantime, can you please execute "cat /mmc/test.lua" from >> the shell and confirm that it shows the correct data? >> >> Thanks, >> Bogdan >> >> >> >>> >>> TiM >>> >>> >>> >>> ----- Original Message ----- >>> From: "Tim Van Der Hulst" < [hidden email] > >>> To: "eLua Users and Development List ( www.eluaproject.net )" < [hidden email] > >>> Sent: Monday, July 9, 2012 4:00:02 PM >>> Subject: Re: [eLua-dev] mmc - dofile OK, require Fails >>> >>> I most definately have >>> >>> module(...) >>> >>> in my file, yet it still fails! >>> >>> received and saved as /mmc/gprs.lua >>> eLua# recv >>> Waiting for file .done, got 641 bytes >>> -------------- >>> Error: [string "xmodem"]:26: module 'gprs' not found: >>> no field package.preload['gprs'] >>> no file '/mmc/gprs.lua;/mmc/ gprs.lc ;/rom/gprs.lua;/rom/ gprs.lc ' >>> no file '/mmc/ gprs.lc ;/rom/gprs.lua;/rom/ gprs.lc ' >>> no file '/rom/gprs.lua;/rom/ gprs.lc ' >>> no file '/rom/ gprs.lc ' >>> eLua# >>> >>> -------- >>> >>> I see a very old (2008) thread semi related: >>> >>> https://lists.berlios.de/pipermail/elua-dev/2008-November/000102.html >>> >>> [eLua-dev] Require(path/modulename) >>> >>> -------- >>> >>> Not sure what to test further, >>> >>> TiM >>> >>> >>> >>> ----- Original Message ----- >>> From: "Thiago Naves" < [hidden email] > >>> To: "eLua Users and Development List ( www.eluaproject.net )" < [hidden email] > >>> Sent: Friday, July 6, 2012 12:47:59 PM >>> Subject: Re: [eLua-dev] mmc - dofile OK, require Fails >>> >>> >>> Add >>> local module_name = module_name >>> >>> like >>> >>> local pio = pio >>> local uart = uart >>> local string = string >>> >>> for each module you wish to use in the code at the beginning of your file, >>> then add a >>> >>> module (...) >>> >>> after that to make you file into a module. >>> >>> Then you'll be able to use the require, but the dofile will not work. >>> >>> I've attached my MIDI module as an example. >>> >>> >>> Best, >>> Thiago >>> >>> >>> >>> >>> On Thu, Jul 5, 2012 at 6:31 PM, Tim Van Der Hulst < [hidden email] > wrote: >>> >>> >>> Hi there, >>> >>> Might be coffee time but... >>> >>> dofile('/mmc/test.lua') -- OK >>> require('test') -- Fail!! >>> >>> ------------- >>> /mmc >>> test.txt 5 bytes >>> gprs.lua 2910 bytes >>> util.lua 385 bytes >>> test.lua 385 bytes >>> >>> Total on /mmc: 3685 bytes >>> >>> ------------- >>> >>> Error: [string "xmodem"]:23: module 'test' not found: >>> no field package.preload['test'] >>> no file '/mmc/test.lua;/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' >>> no file '/mmc/ test.lc ;/rom/test.lua;/rom/ test.lc ' >>> no file '/rom/test.lua;/rom/ test.lc ' >>> no file '/rom/ test.lc ' >>> >>> ------------ >>> >>> I'm running on platform STM32 >>> The CPU is a STM32F103RE >>> The board name is ET-STM32 >>> >>> ------------ >>> >>> Help please! >>> >>> TiM >>> _______________________________________________ >>> eLua-dev mailing list >>> [hidden email] >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> >>> >>> _______________________________________________ >>> eLua-dev mailing list >>> [hidden email] >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> _______________________________________________ >>> eLua-dev mailing list >>> [hidden email] >>> https://lists.berlios.de/mailman/listinfo/elua-dev >>> _______________________________________________ >>> eLua-dev mailing list >>> [hidden email] >>> https://lists.berlios.de/mailman/listinfo/elua-dev >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev >> >> >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev >> _______________________________________________ >> eLua-dev mailing list >> [hidden email] >> https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Free forum by Nabble | Edit this page |