These are chat archives for machinekit/machinekit

30th
Jun 2016
Michael Haberler
@mhaberler
Jun 30 2016 12:26
@zhivko : see this zeromq/libzmtp#43 - libzmtp XSUB actually works
no automatic reconnect in libzmtp, needs manual management
zhivko
@zhivko
Jun 30 2016 14:12
so Idea is to have zeromq client on embeded platform like arduino that send zmq messages to halgroup/halcmd service on pc host? is that right ?
So this basic usecase - I could try and compile this on my esp8266 platform - maybe it could work
Michael Haberler
@mhaberler
Jun 30 2016 14:28
yes
Michael Haberler
@mhaberler
Jun 30 2016 14:49
note libzmtp is a very basic reference implementation - lots of assert()s
zhivko
@zhivko
Jun 30 2016 16:40
Hmm talking about asserts, testing mk I just got:
Issuing EMC_TASK_PLAN_OPEN --      (+506,+268,   +11,/home/machinekit/machinekit/nc_files/prog.gcode,)
emcTaskPlanOpen(/home/machinekit/machinekit/nc_files/prog.gcode) returned 0
waiting for command #10from ['56E58679-B43F81A0'] to complete
sending task message
sending motion message
Assertion failed: state == term_ack_sent || state == term_req_sent2 (pipe.cpp:316)
/home/machinekit/git/machinekit/scripts/linuxcnc: line 816:  3752 Aborted                 $EMCDISPLAY -ini "$INIFILE" $EMCDISPLAYARGS $EXTRA_ARGS
Shutting down and cleaning up Machinekit...
send_pbcontainer: type: MT_PING
hmm where that came from?
zmq?
zhivko
@zhivko
Jun 30 2016 16:46
hmmm... restarted mk... and it works no problem
zhivko
@zhivko
Jun 30 2016 17:49
This message was deleted
zhivko
@zhivko
Jun 30 2016 17:55

I tried to use that - I would epect something like:

    pb::Container container, got;


    pb::Pin *pin;
    pb::Value *value;

    // type-tag the container:
    container.set_type(pb::ContainerType::MT_HALUPDATE);
    container.set_serial(56789);
    container.set_rsvp(pb::ReplyType::NONE);


    // add repeated submessage(s)
    pin = container.add_pin();
    pin->set_type(pb::ValueType::HAL_S32);
    pin->set_name("foo.1.bar");
    pin->set_hals32(4711);

    value = container.add_value();
    value->set_type(pb::ValueType::DOUBLE);
    value->set_v_double(3.14159);

    //std::string json = pb2json(container);

to be used with minimal zmq https://github.com/mhaberler/libzmtp - maybe I am wrong ?

Michael Haberler
@mhaberler
Jun 30 2016 20:52
is there any reason for these copy & paste excerpts which leave out the relevant part? post a link to a file in github