Additional library for MikroBasic PRO 2009

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

Additional library for MikroBasic PRO 2009

#1 Post by yo2lio » 12 May 2009 10:54

Hello all,

Additional library for MikroBasic PRO 2009 are available here :
http://www.microelemente.ro/MikroBasic/ ... y_V1_2.zip

This setup will install the following files in \Uses\P18 folder :

all_digital.mbas
Bit_Lib.mcl
Bootloader_lib_V7_ZABBIX_64K.mcl
Bootloader_lib_V7_ZABBIX_96K.mcl
Bootloader_lib_V7_ZABBIX_128K.mcl
CAN_lib.mcl
definitions_enc.mcl
Flash_Mem_Library.mcl
Frecv_lib_P18.mcl
lib1_18f97j60_v3_5.mcl
lib1_enc28j60_v3_5.mcl
lib2_18F97J60_V3_5.mcl
lib2_enc28j60_V3_5.mcl
lib1_18f97j60_v3_4.mcl
lib1_enc28j60_v3_4.mcl
lib2_18F97J60_V3_4.mcl
lib2_enc28j60_V3_4.mcl
Lib_Delays_LIO.mbas
onewire_base.mcl
pic_additional_string_library.mcl
SDMMC_SPI1.mcl
SDMMC_SPI2.mcl
sensirion_lib_P18.mcl
snmp_library_user.mcl
Termal_Library_My.mcl
PPS_Library.mcl

MB_PRO_Library_V1_2_Uninstall.exe


Examples for this libraries will be available soon.

Enjoy!
Last edited by yo2lio on 19 May 2009 11:08, edited 1 time in total.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

Bytex
Posts: 459
Joined: 23 Jun 2008 00:58
Location: Palmanova (UD), Italy
Contact:

#2 Post by Bytex » 12 May 2009 14:44

Thanks Florin :D

Best regards,
Max

http://www.b-vu.com

pachoncito
Posts: 10
Joined: 28 Jun 2005 05:14
Location: Mexico DF
Contact:

Mix of libraries

#3 Post by pachoncito » 13 May 2009 04:49

I have some questions

1.- I cant find a dns resolver in your library, then can i use ME function for this case?

2.- Why are the best use for send_tcp? my app try to send a http request to server, in two different ways, the first :

dim header as String[100]

str2ip("my ip address",my_app);

i'm looking for ip via http at remote server

tcp_open(5000)
open_tcp_conection(my_app,80,5000)
cadena="GET /resolve_exe?arg=ciasamx.com"+ chr(13)+chr(10)+ "host: www.tracert.com" + chr(13) + chr(10)
send_tcp(my_app,80,str_len(cadena),cadena)
......
......
close tcp_conection(my_app)
tcp_close_port(5020)


then in the enc_lib_user
in eth_user_tcp:

when source port = 5000 then call my own function
.......

........

in my own function:

i get the response from server, etc
but server response 400 bad request javascript:emoticon(':shock:')

i try the same example from telnet some like:

telnet www.tracert.com 80
GET /resolve_exe?arg=ciasamx.com + CR
host: www.tracert.com + CR + CR
and i get the IP from the the request



in the other way

tcp_open(5000)
open_tcp_conection(my_app,80,5000)
......
......


then in the enc_lib_user
in eth_user_tcp:

when source port = 5000 then call my own function
.......

........

in my own function:
cadena="GET /resolve_exe?arg=ciasamx.com"+ chr(13)+chr(10)+ "host: www.tracert.com" + chr(13) + chr(10)
send_tcp(my_app,80,str_len(cadena,cadena)
goto end rutine

exit

end_rutine:

Socket[j].RAM_ROM=0
Socket[j].Start_addr=@cadena
Socket[j].Stop_addr=@cadena + str_len(cadena)


end sub

in this case i never get response or conection to port 5000 from server i tes if the conection is alive in tcp socket at server side and i see it in netstat at server side it s status is established javascript:emoticon(':(')


Thanks for your kind attention

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#4 Post by yo2lio » 13 May 2009 10:30

Hello,

Examples for library will be available soon.

Till then, I will show you the routine for preparing HTTP data :

Code: Select all

include pic_additional_string_library

dim http_send as string[1024]
    device_id as word ' some variable
    ntp as longword   ' some variable
    host_name as string[64] 'test.yahoo.com
    http_send_port as word
    
sub procedure PrepareHTTPdata
dim txt_buf as string[64]
    EOL as string[2]

  EOL[0] = $0D
  EOL[1] = $0A
  EOL[2] = 0
  
  http_send ="GET /achizitie1.php?ID="

  Word2Str(device_id,txt_buf)
  Str_Cat(http_send,txt_buf)
  
  txt_buf ="&Ntp="
  Str_Cat(http_send,txt_buf)
  LongWord2Str(ntp,txt_buf)
  Str_Cat(http_send,txt_buf)

  txt_buf ="&status=1 HTTP/1.1"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Host: "
  Str_Cat(txt_buf,host_name)
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="User-Agent: my user agent name"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Accept: text/html"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Accept-Language: en-us,enq=0.5"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Accept-Encoding: deflate"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Accept-Charset: ISO-8859-1"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Keep-Alive: 300"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  txt_buf ="Connection: keep-alive"
  Str_Cat(http_send,txt_buf)
  Str_Cat(http_send,EOL)
  Str_Cat(http_send,EOL)

end sub

main:
  PrepareHTTPdata
  
  if inc(http_send_port) > 60000 then http_send_port = 5000 end if ' increment my port

  TCP_Open_Port(http_send_port)

  if Open_TCP_Connection(http_server_address, 80, http_send_port) then
    Send_TCP(http_server_address, 80, Str_Len(http_send), http_send)
    Close_TCP_Connection(http_server_address, 80);
  end if

  TCP_Close_Port(http_send_port)
  
end.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

pachoncito
Posts: 10
Joined: 28 Jun 2005 05:14
Location: Mexico DF
Contact:

Send TCP

#5 Post by pachoncito » 13 May 2009 12:58

Thanks for your fast response latter i try the code, great work :D

dAb
Posts: 124
Joined: 26 Oct 2005 10:36
Location: UK

#6 Post by dAb » 17 May 2009 16:53

Thanks Florin - much appreciated, look forwards to examples

dAb

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#7 Post by yo2lio » 19 May 2009 11:07

Library updated. See first post...

Added support for Ethernet Library V3_4.
Added support for Peripheral Pin Select, thanks to JPC.

The Ethernet Library V3_4 is V3_5 without TCP/IP stack.
Include also DHCP, DNS and firewall policy. Be careful at opened ports... See V3_5 example.

Before installations you must uninstall old version with MB_PRO_Library_V1_1_Uninstall.exe from /Uses/P18 folder.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

Alan_c
Posts: 8
Joined: 14 Mar 2006 19:46
Location: uk

#8 Post by Alan_c » 11 Aug 2009 19:44

hI

Im new to MikroBasic Pro and was wondering if somebody clarify how to update my download with the new Lib. I dont know whats installed where to be honest. I saw the following post below from the Mikro Team


"Before installations you must uninstall old version with MB_PRO_Library_V1_1_Uninstall.exe from /Uses/P18 folder "

Regards

Alan

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#9 Post by yo2lio » 12 Aug 2009 08:23

Alan_c wrote:Im new to MikroBasic Pro and was wondering if somebody clarify how to update my download with the new Lib. I dont know whats installed where to be honest. I saw the following post below from the Mikro Team


"Before installations you must uninstall old version with MB_PRO_Library_V1_1_Uninstall.exe from /Uses/P18 folder "
Hello Alan,

I want to clarify one thing:

This library "Additional library for MikroBasic PRO 2009" is made by me and I use this in all my applications.
Practically I share my work and experience with you.
If something goes wrong (the library don't work like expected) I'm guilty for this not Mikroe Team !

At this moment, this library, (MB version) is not documented and I don't have examples for this.
I have examples only for MikroPascal version: http://www.mikroe.com/forum/viewtopic.php?t=19970

I will do my best to make some documentation and examples.

About your problem, before a new installation, you must uninstall old version only if you used old version before.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

#10 Post by p.erasmus » 27 Aug 2009 18:17

Hi
I have downloaded the additional lib from the link
however looking into my Uses folder I do not find the unintall
function as mentioned to uninstall the old lib
MB_PRO_Library_V1_1_Uninstall.exe from /Uses/P18 folder "
I have only .mcl files in this folder any help appreciated

Regards
P.Erasmus
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#11 Post by yo2lio » 27 Aug 2009 18:25

You will found uninstall only if you have the old library installed.

Just install the new library ....
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

#12 Post by p.erasmus » 27 Aug 2009 19:17

Thank you very much!!
Regards
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#13 Post by yo2lio » 27 Aug 2009 20:23

Examples and documentations for this libraries (for now in MikroPascal only) are available here :

http://www.microelemente.ro/MikroPascal ... xample.zip
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

#14 Post by p.erasmus » 28 Aug 2009 07:54

yo2lio

Thank you for makeing your extended Lib available to us working with the
mE compilers ,
It is very kind of you and it helps people like me who can not write these type of function myself ,it helps us to speed up our work and it makes the compiler very good

Best regards
Peter
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#15 Post by yo2lio » 15 Sep 2009 15:57

Hello all,

Additional library for MikroBasic PRO 2009 are available here :
http://www.microelemente.ro/MikroBasic/ ... y_V1_3.zip

This setup will install the following files in \Uses\P18 folder :

all_digital.mpas
Bit_Lib.mcl
Bootloader_lib_V7_ZABBIX_64K.mcl
Bootloader_lib_V7_ZABBIX_96K.mcl
Bootloader_lib_V7_ZABBIX_128K.mcl
CAN_lib.mcl
definitions_enc.mcl
Flash_Mem_Library.mcl
Frecv_lib_P18.mcl
lib1_18f97j60_v3_5.mcl
lib1_enc28j60_v3_5.mcl
lib2_18F97J60_V3_5.mcl
lib2_enc28j60_V3_5.mcl
lib1_18f97j60_v3_4.mcl
lib1_enc28j60_v3_4.mcl
lib2_18F97J60_V3_4.mcl
lib2_enc28j60_V3_4.mcl
Lib_Delays_LIO.mpas
onewire_base.mcl
pic_additional_string_library.mcl
SDMMC_SPI1.mcl
SDMMC_SPI2.mcl
sensirion_lib_P18.mcl
snmp_library_user.mcl
snmp_library_user_32.mcl
Termal_Library_My.mcl
PPS_Library.mcl

MP_PRO_Library_V1_3_Uninstall.exe


Examples and documentations for this libraries (for now in MikroPascal only) are available here :

http://www.microelemente.ro/MikroPascal ... xample.zip


added SaveAll procedure in pic_additional_string_library.

call this routine in main and interrupt routine, if you want to save FSRx and PRODx registers in interrupt.
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro

Post Reply

Return to “mikroBasic PRO for PIC General”