Create a field collection field programmatically
Have you tried using entity metadata wrappers? They come with the Entity API module and allow you to do this (copied from linked documentation):

&lt;?php
    // Populate the fields.
    $ewrapper = entity_metadata_wrapper('node', $node);
    $ewrapper-&gt;field_lead_contact_name-&gt;set($contact_name);
    $ewrapper-&gt;field_lead_contact_phone-&gt;set($contact_phone);
    $ewrapper-&gt;field_lead_contact_email-&gt;set($contact_email);  

    // Create the collection entity and set it's "host".
    $collection = entity_create('field_collection_item', array('field_name' =&gt; 'field_facilities_requested'));
    $collection-&gt;setHostEntity('node', $node);  

    // Now define the collection parameters.
    $cwrapper = entity_metadata_wrapper('field_collection_item', $collection);
    $cwrapper-&gt;field_facility-&gt;set(intval($offset));
    $cwrapper-&gt;save();  

    // Save.
    $ewrapper-&gt;save();
?&gt;


In this example a node and the attached fieldset are created at the same time, so it might just work with only below code. Perhaps it is required to save the node afterwards, I have not tested it.

&lt;?php
    // Create the collection entity and set it's "host".
    $collection = entity_create('field_collection_item', array('field_name' =&gt; 'field_facilities_requested'));
    $collection-&gt;setHostEntity('node', $node);  

    // Now define the collection parameters.
    $cwrapper = entity_metadata_wrapper('field_collection_item', $collection);
    $cwrapper-&gt;field_facility-&gt;set(intval($offset));
    $cwrapper-&gt;save();
?&gt;


Update:

At the bottom of the Entity Metadata Wrapper documentation (before the comments) there are some lines about debugging and finding available parameters. That also might be of help while attempting to find the right property.