[Logo] Mango M2M Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
help for bacnet and bacnet4J  XML
Forum Index -> BACnet4J general discussion
Author Message
ilyass

Initiate

Joined: 21/07/2010 11:29:20
Messages: 5
Offline

Hi,

I am new in Bacnet and Bacnet4J. I am developping an slave bacnet application. this application has to discover a list of bacnet objects/devices and after to manage its. I am using VTS (Virtual Tset Shell) to test my application.
I have some questions, so :

1- i create a localDevice
Code:
LocalDevice localDevice = new LocalDevice(1, "10.193.224.255", "10.193.224.239");

10.193.224.255 : address broadcast
and after i initialise it
Code:
try {
          	localDevice.initialize();
          }catch(IOException e) {
          	System.out.println("IO Error!");
          	e.printStackTrace();
          	return;
          }

finally i send a broadcast request
Code:
localDevice.sendBroadcast(0xBAC0, new WhoIsRequest(null, null));

but the list of object is empty and VTS doesn't receive any thing, i don't know why because with VTS i create devices and objects that have "10.193.224.177" address IP. So i don't know how i can do this

2- what is the different between remoteDevice and localDevice ?

3- second test : with VTS i send WhoIsRequest

after i create a bacnet object in my application
Code:
LocalDevice localDevice = new LocalDevice(1, "10.193.224.255", "10.193.224.239");         
          BACnetObject bacnetObj = new BACnetObject(localDevice, new ObjectIdentifier(ObjectType.analogInput, 10));
          bacnetObj.setProperty(PropertyIdentifier.objectName, new CharacterString("TemperatureSensorOneRF"));
          bacnetObj.setProperty(PropertyIdentifier.description, new CharacterString("Controller of TemperatureSensor"));

after i send :
Code:
 localDevice.sendBroadcast(0xBAC0, new IAmRequest(new ObjectIdentifier(ObjectType.analogInput, 10), new UnsignedInteger(1024), Segmentation.noSegmentation, new UnsignedInteger(236)));

But VTS doesn't receive any thing

thanks for help
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 980
Offline

Can you use wireshark to try and figure out what's going on? At least to produce some message traces?

Best regards,
Matthew Lohbihler
ilyass

Initiate

Joined: 21/07/2010 11:29:20
Messages: 5
Offline

Hi,

I found the solution of my problem. On VTS I configured the network as remote network but i test in local network. So i changed it and now i receive informations from my application

Thank you for your help.

Just an other question, i have this exception when i send UnconfirmedTextMessage via VTS :
Code:
 
 com.serotonin.bacnet4j.exception.BACnetException: Error while creating APDU: 
 	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.runImpl(IpMessageControl.java:501)
 	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.run(IpMessageControl.java:455)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:619)
 Caused by: com.serotonin.bacnet4j.exception.BACnetException: java.lang.reflect.InvocationTargetException
 	at com.serotonin.bacnet4j.type.Encodable.read(Encodable.java:174)
 	at com.serotonin.bacnet4j.type.Encodable.read(Encodable.java:186)
 	at com.serotonin.bacnet4j.type.constructed.Choice.read(Choice.java:65)
 	at com.serotonin.bacnet4j.type.constructed.Choice.<init>(Choice.java:54)
 	at com.serotonin.bacnet4j.service.unconfirmed.UnconfirmedTextMessageRequest.<init>(UnconfirmedTextMessageRequest.java:100)
 	at com.serotonin.bacnet4j.service.unconfirmed.UnconfirmedRequestService.createUnconfirmedRequestService(UnconfirmedRequestService.java:46)
 	at com.serotonin.bacnet4j.apdu.UnconfirmedRequest.<init>(UnconfirmedRequest.java:62)
 	at com.serotonin.bacnet4j.apdu.APDU.createAPDU(APDU.java:38)
 	at com.serotonin.bacnet4j.npdu.ip.IpMessageControl$IncomingMessageExecutor.runImpl(IpMessageControl.java:498)
 	... 4 more
 Caused by: java.lang.reflect.InvocationTargetException
 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
 	at com.serotonin.bacnet4j.type.Encodable.read(Encodable.java:171)
 	... 12 more
 Caused by: com.serotonin.bacnet4j.exception.BACnetErrorException: 29
 	at com.serotonin.bacnet4j.type.primitive.CharacterString.validateEncoding(CharacterString.java:138)
 	at com.serotonin.bacnet4j.type.primitive.CharacterString.<init>(CharacterString.java:80)
 	... 17 more
 


do you know why ?

thanks
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 980
Offline

The character encoding you are using is not recognized. The reference value is 29, but the only valid values AFAIK are:

Code:
    public interface Encodings {
         byte ANSI_X3_4 = 0;
         byte IBM_MS_DBCS = 1;
         byte JIS_C_6226 = 2;
         byte ISO_10646_UCS_4 = 3;
         byte ISO_10646_UCS_2 = 4;
         byte ISO_8859_1 = 5;
     }
 


Can you provide a trace of the message?

Best regards,
Matthew Lohbihler
ilyass

Initiate

Joined: 21/07/2010 11:29:20
Messages: 5
Offline

With VTS, when i sent UnconfirmedTextMessage, i specified a numeric class witch doesn't exists, so my application throws exception

thank you for your help

[Thumb - vts.JPG]
 Filename vts.JPG [Disk] Download
 Description
 Filesize 53 Kbytes
 Downloaded:  9 time(s)

mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 980
Offline

Code changes have been made so that a more informative error message is provided.

Best regards,
Matthew Lohbihler
ilyass

Initiate

Joined: 21/07/2010 11:29:20
Messages: 5
Offline

Hi,

I have a question about SubscribeCOVRequest; it is possible to make the subscription COV for all time and not for a specific lifetime ?

thanks for help
mlohbihler


[Avatar]

Joined: 01/03/2007 22:48:52
Messages: 980
Offline

From the spec:

13.14.1.5 Lifetime

This parameter, of type Unsigned, shall convey the desired lifetime of the subscription in seconds. A value of zero shall
indicate an indefinite lifetime, without automatic cancellation. A non-zero value shall indicate the number of seconds that
may elapse before the subscription shall be automatically cancelled. If both the 'Issue Confirmed Notifications' and 'Lifetime'
parameters are absent, then this shall indicate a cancellation request. If the 'Lifetime' parameter is present then the 'Issue
Confirmed Notifications' parameter shall be present. 

Best regards,
Matthew Lohbihler
 
Forum Index -> BACnet4J general discussion
Go to:   
Powered by JForum 2.1.7 © JForum Team